Beispiel #1
0
 public function getRoutesFromExtension(Extension $extension)
 {
     $api = '\\' . $extension->getNamespace() . '\\Api';
     if (class_exists($api)) {
         return new $api();
     }
     return null;
 }
Beispiel #2
0
 /**
  * @param \Jigoshop\Extensions\Extension $extension
  */
 public function installExtension($extension)
 {
     $this->classLoader->addPsr4($extension->getNamespace() . '\\', $extension->getPath());
     $configuration = $extension->getConfiguration();
     if ($configuration && $configuration instanceof \Jigoshop\Container\Configurations\ConfigurationInterface) {
         $this->container->configurations->add($configuration);
     }
     $installer = $extension->getInstaller();
     if ($installer && $installer instanceof \Jigoshop\Extensions\InstallerInterface) {
         $installer->init($this->container);
         $installer->install();
     }
 }