From ad1d0be4208fcae987e8ad7e33fdeba9a2df8d65 Mon Sep 17 00:00:00 2001 From: Artur Eshenbrener Date: Fri, 3 Oct 2014 18:28:16 +0400 Subject: [PATCH] Accessing to option 'optimize-autoloder' inside 'post-autoload-dump' script event. --- src/Composer/Autoload/AutoloadGenerator.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Composer/Autoload/AutoloadGenerator.php b/src/Composer/Autoload/AutoloadGenerator.php index 836acafe8..dd23cee8a 100644 --- a/src/Composer/Autoload/AutoloadGenerator.php +++ b/src/Composer/Autoload/AutoloadGenerator.php @@ -53,7 +53,9 @@ class AutoloadGenerator public function dump(Config $config, InstalledRepositoryInterface $localRepo, PackageInterface $mainPackage, InstallationManager $installationManager, $targetDir, $scanPsr0Packages = false, $suffix = '') { - $this->eventDispatcher->dispatchScript(ScriptEvents::PRE_AUTOLOAD_DUMP, $this->devMode); + $this->eventDispatcher->dispatchScript(ScriptEvents::PRE_AUTOLOAD_DUMP, $this->devMode, array( + 'optimize' => (bool) $scanPsr0Packages + )); $filesystem = new Filesystem(); $filesystem->ensureDirectoryExists($config->get('vendor-dir')); @@ -235,7 +237,9 @@ EOF; fclose($targetLoader); unset($sourceLoader, $targetLoader); - $this->eventDispatcher->dispatchScript(ScriptEvents::POST_AUTOLOAD_DUMP, $this->devMode); + $this->eventDispatcher->dispatchScript(ScriptEvents::POST_AUTOLOAD_DUMP, $this->devMode, [ + 'optimize' => (bool) $scanPsr0Packages, + ]); } public function buildPackageMap(InstallationManager $installationManager, PackageInterface $mainPackage, array $packages)