Permalink
Browse files

Tweaking dispatchScript method to be in line with the rest, and add d…

…evMode to *_AUTOLOAD_DUMP events
  • Loading branch information...
1 parent 790a25c commit 5fb005631a7de07db83ae8af894b7a600fe6004e @Seldaek Seldaek committed Mar 1, 2014
Showing with 4 additions and 8 deletions.
  1. +2 −2 src/Composer/Autoload/AutoloadGenerator.php
  2. +2 −6 src/Composer/EventDispatcher/EventDispatcher.php
@@ -46,7 +46,7 @@ public function setDevMode($devMode = true)
public function dump(Config $config, InstalledRepositoryInterface $localRepo, PackageInterface $mainPackage, InstallationManager $installationManager, $targetDir, $scanPsr0Packages = false, $suffix = '')
{
- $this->eventDispatcher->dispatchScript(ScriptEvents::PRE_AUTOLOAD_DUMP);
+ $this->eventDispatcher->dispatchScript(ScriptEvents::PRE_AUTOLOAD_DUMP, $this->devMode);
$filesystem = new Filesystem();
$filesystem->ensureDirectoryExists($config->get('vendor-dir'));
@@ -228,7 +228,7 @@ public static function autoload(\$class)
fclose($targetLoader);
unset($sourceLoader, $targetLoader);
- $this->eventDispatcher->dispatchScript(ScriptEvents::POST_AUTOLOAD_DUMP);
+ $this->eventDispatcher->dispatchScript(ScriptEvents::POST_AUTOLOAD_DUMP, $this->devMode);
}
public function buildPackageMap(InstallationManager $installationManager, PackageInterface $mainPackage, array $packages)
@@ -75,13 +75,9 @@ public function dispatch($eventName, Event $event = null)
* @param string $eventName The constant in ScriptEvents
* @param Script\Event $event
*/
- public function dispatchScript($eventName, Script\Event $event = null)
+ public function dispatchScript($eventName, $devMode = false)
{
- if (null == $event) {
- $event = new Script\Event($eventName, $this->composer, $this->io);
- }
-
- $this->doDispatch($event);
+ $this->doDispatch(new Script\Event($eventName, $this->composer, $this->io, $devMode));
}
/**

0 comments on commit 5fb0056

Please sign in to comment.