/** * 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); }
/** * 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. * * @throws Enlight_Exception * @param $name * @return Enlight_Plugin_Namespace_Config */ public function load($name) { if ($this->storage->plugins->{$name} === null || $this->plugins->offsetExists($name)) { return parent::load($name); } $item = $this->storage->plugins->{$name}; /** @var $plugin Enlight_Plugin_Bootstrap_Config */ $plugin = new $item->class($name, $this); return parent::registerPlugin($plugin); }