1
0
Fork 0

Make Event devMode argument optional (false by default).

pull/1456/head
Ronny López 2013-01-10 18:12:46 +01:00
parent e5cbf83185
commit f627c3c603
3 changed files with 9 additions and 5 deletions

View File

@ -186,7 +186,7 @@ EOF;
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');
$this->eventDispatcher->dispatch(ScriptEvents::POST_AUTOLOAD_DUMP, false);
$this->eventDispatcher->dispatch(ScriptEvents::POST_AUTOLOAD_DUMP);
}
public function buildPackageMap(InstallationManager $installationManager, PackageInterface $mainPackage, array $packages)

View File

@ -50,7 +50,7 @@ class Event
* @param IOInterface $io The IOInterface object
* @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->composer = $composer;

View File

@ -55,11 +55,15 @@ class EventDispatcher
* Dispatch a script event.
*
* @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);
}
/**