1
0
Fork 0

Tweaking dispatchScript method to be in line with the rest, and add devMode to *_AUTOLOAD_DUMP events

pull/2773/merge
Jordi Boggiano 2014-03-01 21:22:01 +01:00
parent 790a25c348
commit 5fb005631a
2 changed files with 4 additions and 8 deletions

View File

@ -46,7 +46,7 @@ class AutoloadGenerator
public function dump(Config $config, InstalledRepositoryInterface $localRepo, PackageInterface $mainPackage, InstallationManager $installationManager, $targetDir, $scanPsr0Packages = false, $suffix = '') 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 = new Filesystem();
$filesystem->ensureDirectoryExists($config->get('vendor-dir')); $filesystem->ensureDirectoryExists($config->get('vendor-dir'));
@ -228,7 +228,7 @@ EOF;
fclose($targetLoader); fclose($targetLoader);
unset($sourceLoader, $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) public function buildPackageMap(InstallationManager $installationManager, PackageInterface $mainPackage, array $packages)

View File

@ -75,13 +75,9 @@ class EventDispatcher
* @param string $eventName The constant in ScriptEvents * @param string $eventName The constant in ScriptEvents
* @param Script\Event $event * @param Script\Event $event
*/ */
public function dispatchScript($eventName, Script\Event $event = null) public function dispatchScript($eventName, $devMode = false)
{ {
if (null == $event) { $this->doDispatch(new Script\Event($eventName, $this->composer, $this->io, $devMode));
$event = new Script\Event($eventName, $this->composer, $this->io);
}
$this->doDispatch($event);
} }
/** /**