Tweaking dispatchScript method to be in line with the rest, and add devMode to *_AUTOLOAD_DUMP events
parent
790a25c348
commit
5fb005631a
|
@ -46,7 +46,7 @@ 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->eventDispatcher->dispatchScript(ScriptEvents::PRE_AUTOLOAD_DUMP, $this->devMode);
|
||||
|
||||
$filesystem = new Filesystem();
|
||||
$filesystem->ensureDirectoryExists($config->get('vendor-dir'));
|
||||
|
@ -228,7 +228,7 @@ EOF;
|
|||
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 @@ class EventDispatcher
|
|||
* @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));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue