Exemplo n.º 1
0
 /**
  * Whenever you call this method, you shall have already downloaded the extension
  * And have set the source directory on the Extension object.
  */
 public function installExtension(Extension $ext, array $options = array())
 {
     $this->disableExtension($ext);
     $sourceDir = $ext->getSourceDirectory();
     $name = $ext->getName();
     if (!file_exists($sourceDir)) {
         throw new Exception("Source directory {$sourceDir} does not exist.");
     }
     // Install local extension
     $installer = new ExtensionInstaller($this->logger);
     $this->logger->info("===> Installing {$name} extension...");
     $this->logger->debug("Extension path {$sourceDir}");
     // $installer->runInstall($name, $sourceDir, $options);
     $installer->install($ext, $options);
     $this->createExtensionConfig($ext);
     $this->enableExtension($ext);
     $this->logger->info("Done.");
     return $sourceDir;
 }