/** * @param Plugin $plugin * @param Shop $shop * @return array */ public function getPluginConfig(Plugin $plugin, Shop $shop = null) { $namespace = $this->plugins->get($plugin->getNamespace()); /** @var \Shopware_Components_Plugin_Namespace $namespace */ $config = $namespace->getConfig($plugin->getName(), $shop); return $config->toArray(); }
/** * @param Container $container * @param \Enlight_Loader $loader * @param \Enlight_Event_EventManager $eventManager * @param \Shopware $application * @param array $config * @return \Enlight_Plugin_PluginManager */ public function factory(Container $container, \Enlight_Loader $loader, \Enlight_Event_EventManager $eventManager, \Shopware $application, array $config) { $pluginManager = new \Enlight_Plugin_PluginManager($application); $container->load('Table'); if (!isset($config['namespaces'])) { $config['namespaces'] = array('Core', 'Frontend', 'Backend'); } foreach ($config['namespaces'] as $namespace) { $namespace = new \Shopware_Components_Plugin_Namespace($namespace); $pluginManager->registerNamespace($namespace); $eventManager->registerSubscriber($namespace->Subscriber()); } foreach (array('Local', 'Community', 'Default', 'Commercial') as $dir) { $loader->registerNamespace('Shopware_Plugins', Shopware()->AppPath('Plugins_' . $dir)); } return $pluginManager; }
public function testLoadException() { $this->setExpectedException('Enlight_Exception', 'Plugin "test" not found failure'); $this->manager->get('test'); }