/** * Loads a plugin in the plugin namespace by name over the Enlight_Config. * * * @param $name * @param bool $throwException * @return \Enlight_Plugin_Namespace_Config|\Enlight_Plugin_PluginCollection */ public function load($name, $throwException = true) { $item = $this->Storage()->plugins->{$name}; if ($item === null || $this->plugins->offsetExists($name) || !class_exists($item->class)) { return parent::load($name, $throwException); } /** @var $plugin Enlight_Plugin_Bootstrap_Config */ $plugin = new $item->class($name, $item); return parent::registerPlugin($plugin, $throwException); }
/** * Loads a plugin in the plugin namespace by name over the Enlight_Config. * * * @param $name * @param bool $throwException * @return \Enlight_Plugin_Namespace_Config|\Enlight_Plugin_PluginCollection */ public function load($name, $throwException = true) { $item = $this->Storage()->plugins->{$name}; if ($item === null || $this->plugins->offsetExists($name) || !(class_exists($item->class) || class_exists($item->class . 'Dummy'))) { return parent::load($name, $throwException); } /** @var $item \Enlight_Config */ $classname = $item->get('class'); if (!class_exists($classname)) { $classname .= 'Dummy'; } /** @var $plugin Enlight_Plugin_Bootstrap_Config */ $plugin = new $classname($name, $item); return parent::registerPlugin($plugin, $throwException); }
/** * Registers a plugin in the collection. * * @param Enlight_Plugin_Bootstrap_Config $plugin * @return Enlight_Plugin_Namespace_Config */ public function registerPlugin(Enlight_Plugin_Bootstrap_Config $plugin) { parent::registerPlugin($plugin); $plugin->install(); return $this; }