/** * @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); }
/** * @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); }