Make Event devMode argument optional (false by default).
parent
e5cbf83185
commit
f627c3c603
|
@ -186,7 +186,7 @@ EOF;
|
||||||
file_put_contents($targetDir.'/autoload_real.php', $this->getAutoloadRealFile(true, true, (bool) $includePathFile, $targetDirLoader, $filesCode, $vendorPathCode, $appBaseDirCode, $suffix));
|
file_put_contents($targetDir.'/autoload_real.php', $this->getAutoloadRealFile(true, true, (bool) $includePathFile, $targetDirLoader, $filesCode, $vendorPathCode, $appBaseDirCode, $suffix));
|
||||||
copy(__DIR__.'/ClassLoader.php', $targetDir.'/ClassLoader.php');
|
copy(__DIR__.'/ClassLoader.php', $targetDir.'/ClassLoader.php');
|
||||||
|
|
||||||
$this->eventDispatcher->dispatch(ScriptEvents::POST_AUTOLOAD_DUMP, false);
|
$this->eventDispatcher->dispatch(ScriptEvents::POST_AUTOLOAD_DUMP);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildPackageMap(InstallationManager $installationManager, PackageInterface $mainPackage, array $packages)
|
public function buildPackageMap(InstallationManager $installationManager, PackageInterface $mainPackage, array $packages)
|
||||||
|
|
|
@ -50,7 +50,7 @@ class Event
|
||||||
* @param IOInterface $io The IOInterface object
|
* @param IOInterface $io The IOInterface object
|
||||||
* @param boolean $devMode Whether or not we are in dev mode
|
* @param boolean $devMode Whether or not we are in dev mode
|
||||||
*/
|
*/
|
||||||
public function __construct($name, Composer $composer, IOInterface $io, $devMode)
|
public function __construct($name, Composer $composer, IOInterface $io, $devMode = false)
|
||||||
{
|
{
|
||||||
$this->name = $name;
|
$this->name = $name;
|
||||||
$this->composer = $composer;
|
$this->composer = $composer;
|
||||||
|
|
|
@ -55,11 +55,15 @@ class EventDispatcher
|
||||||
* Dispatch a script event.
|
* Dispatch a script event.
|
||||||
*
|
*
|
||||||
* @param string $eventName The constant in ScriptEvents
|
* @param string $eventName The constant in ScriptEvents
|
||||||
* @param boolean $devMode Whether or not we are in dev mode
|
* @param Event $event
|
||||||
*/
|
*/
|
||||||
public function dispatch($eventName, $devMode)
|
public function dispatch($eventName, Event $event = null)
|
||||||
{
|
{
|
||||||
$this->doDispatch(new Event($eventName, $this->composer, $this->io, $devMode));
|
if (null == $event) {
|
||||||
|
$event = new Event($eventName, $this->composer, $this->io);
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->doDispatch($event);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue