예제 #1
0
 /**
  * @return void
  */
 public static function install(PackageEvent $event)
 {
     global $app;
     $composer_json_filename = getenv('COMPOSER');
     $app_root_dir = empty($composer_json_filename) ? getcwd() : dirname($composer_json_filename);
     $app = (require "{$app_root_dir}/bootstrap.php");
     $composer_pkg = $event->getOperation()->getPackage();
     $vendor_dir = getenv('COMPOSER_VENDOR_DIR');
     $vendor_dir_abs = empty($vendor_dir) ? "{$app_root_dir}/vendor" : "{$app_root_dir}/{$vendor_dir}";
     $composer_pkg_dir = $vendor_dir_abs . DIRECTORY_SEPARATOR . $composer_pkg->getName();
     $app->addExtension($composer_pkg_dir);
     $ext_install_event = Event\Type\System\ExtensionInstall::create($composer_pkg);
     $app->dispatch($ext_install_event);
 }
예제 #2
0
 public function testExtensionInstallation()
 {
     $extInstallationEvt = Event\Type\System\ExtensionInstall::create()->setComposerPackageName('phpcrystal/phpcrystal');
     $this->appPkg->dispatch($extInstallationEvt);
 }