Example #1
0
 /**
  * Helper function to build the path to the passed plugin.
  * @param Plugin $plugin
  * @return string
  */
 public function getPluginPath(Plugin $plugin)
 {
     $namespace = strtolower($plugin->getNamespace());
     $source = strtolower($plugin->getSource());
     $name = $plugin->getName();
     return $this->rootDir . DIRECTORY_SEPARATOR . 'engine' . DIRECTORY_SEPARATOR . 'Shopware' . DIRECTORY_SEPARATOR . 'Plugins' . DIRECTORY_SEPARATOR . ucfirst($source) . DIRECTORY_SEPARATOR . ucfirst($namespace) . DIRECTORY_SEPARATOR . ucfirst($name);
 }
Example #2
0
 /**
  * @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();
 }