コード例 #1
0
ファイル: Application.php プロジェクト: opis/colibri
 /**
  * @param Composer $composer
  * @return ClassLoader
  */
 protected function generateClassLoader(Composer $composer) : ClassLoader
 {
     $installMode = $this->info->installMode();
     $config = $this->getConfig();
     $installed = $config->read('modules.installed', []);
     $enabled = $config->read('modules.enabled', []);
     $plugin = new Plugin();
     $plugin->activate($composer, new NullIO());
     $packages = $plugin->preparePacks($installMode, $enabled, $installed);
     $generator = $composer->getAutoloadGenerator();
     $packMap = $generator->buildPackageMap($composer->getInstallationManager(), $composer->getPackage(), $packages);
     $autoload = $generator->parseAutoloads($packMap, $composer->getPackage());
     return $generator->createLoader($autoload);
 }
コード例 #2
0
ファイル: Plugin.php プロジェクト: opis/colibri
 /**
  * @param Event $event
  */
 public function handleDumpAutoload(Event $event)
 {
     $installMode = true;
     $installed = $enabled = [];
     if (!$this->appInfo->installMode()) {
         $installMode = false;
         $collector = new DefaultCollector($this->appInfo);
         /** @var \Opis\Colibri\BootstrapInterface $bootstrap */
         $bootstrap = (require $this->appInfo->bootstrapFile());
         $bootstrap->bootstrap($collector);
         $installed = $collector->getInstalledModules();
         $enabled = $collector->getEnabledModules();
     }
     $this->preparePacks($installMode, $enabled, $installed);
     $this->copyAssets($enabled);
 }