booked/lib/Common/PluginManager.php
/**
	 * @param string $configKey key to use
	 * @param string $pluginSubDirectory subdirectory name under 'plugins'
	 * @param mixed $baseImplementation the base implementation of the plugin.  allows decorating
	 * @return mixed|null plugin implementation
	 */
@param string $configKey key to use
@param string $pluginSubDirectory subdirectory name under 'plugins'
@param mixed $baseImplementation the base implementation of the plugin.  allows decorating
@return mixed|null plugin implementation
@param string $configKey key to use @param string $pluginSubDirectory subdirectory name under ' plugins ' @param mixed $baseImplementation the base implementation of the plugin . allows decorating @return mixed|null plugin implementation
private function LoadPlugin($configKey, $pluginSubDirectory, $baseImplementation)
	{
		if (!$this->Cached($configKey))
		{
			$plugin = Configuration::Instance()->GetSectionKey(ConfigSection::PLUGINS, $configKey);
			$pluginFile = ROOT_DIR . "plugins/$pluginSubDirectory/$plugin/$plugin.php";
			if (!empty($plugin) && file_exists($pluginFile))
			{
				try
				{
					Log::Debug('Loading plugin. Type=%s, Plugin=%s', $configKey, $plugin);
					require_once($pluginFile);
					$this->Cache($configKey, new $plugin($baseImplementation));
				} catch (Exception $ex)
				{
					Log::Error('Error loading plugin. Type=%s, Plugin=%s', $configKey, $plugin);
				}
			}
			else
			{
				$this->Cache($configKey, null);
			}
		}
		return $this->GetCached($configKey);
	}
private function LoadPlugin ( $ configKey , $ pluginSubDirectory , $ baseImplementation ) { if ( ! $ this -> Cached ( $ configKey ) ) { $ plugin = Configuration :: Instance ( ) -> GetSectionKey ( ConfigSection :: PLUGINS , $ configKey ) ; $ pluginFile = ROOT_DIR . " plugins/ $ pluginSubDirectory / $ plugin / $ plugin .php " ; if ( ! empty ( $ plugin ) && file_exists ( $ pluginFile ) ) { try { Log :: Debug ( 'Loading plugin. Type=%s, Plugin=%s' , $ configKey , $ plugin ) ; require_once ( $ pluginFile ) ; $ this -> Cache ( $ configKey , new $ plugin ( $ baseImplementation ) ) ; } catch ( Exception $ ex ) { Log :: Error ( 'Error loading plugin. Type=%s, Plugin=%s' , $ configKey , $ plugin ) ; } } else { $ this -> Cache ( $ configKey , null ) ; } } return $ this -> GetCached ( $ configKey ) ; }
@param string $configKey key to use
 @param string $pluginSubDirectory subdirectory name under 'plugins'
 @param mixed $baseImplementation the base implementation of the plugin.
@param string $configKey key to use @param string $pluginSubDirectory subdirectory name under ' plugins ' @param mixed $baseImplementation the base implementation of the plugin .