Composer API
Class

Composer\Script\EventDispatcher

class EventDispatcher

The Event Dispatcher.

Example in command: $dispatcher = new EventDispatcher($this->getComposer(), $this->getApplication()->getIO()); // ... $dispatcher->dispatch(ScriptEvents::POSTINSTALLCMD); // ...

Methods

__construct(Composer $composer, IOInterface $io, ProcessExecutor $process = null)

Constructor.

dispatch(string $eventName, Event $event = null)

Dispatch a script event.

dispatchPackageEvent(string $eventName, boolean $devMode, OperationInterface $operation)

Dispatch a package event.

dispatchCommandEvent(string $eventName, boolean $devMode)

Dispatch a command event.

Details

at line 47
public __construct(Composer $composer, IOInterface $io, ProcessExecutor $process = null)

Constructor.

Parameters

Composer $composer The composer instance
IOInterface $io The IOInterface instance
ProcessExecutor $process

at line 60
public dispatch(string $eventName, Event $event = null)

Dispatch a script event.

Parameters

string $eventName The constant in ScriptEvents
Event $event

at line 76
public dispatchPackageEvent(string $eventName, boolean $devMode, OperationInterface $operation)

Dispatch a package event.

Parameters

string $eventName The constant in ScriptEvents
boolean $devMode Whether or not we are in dev mode
OperationInterface $operation The package being installed/updated/removed

at line 87
public dispatchCommandEvent(string $eventName, boolean $devMode)

Dispatch a command event.

Parameters

string $eventName The constant in ScriptEvents
boolean $devMode Whether or not we are in dev mode