Final Class Yiisoft\Config\Composer\EventHandler
| Inheritance | Yiisoft\ |
|---|---|
| Implements | Composer\ |
ComposerEventHandler responds to composer event. In the package, its job is to prepare a merge plan that is later used by {@see Config}.
Public Methods
Method Details
| public void activate ( \ | ||
| $composer | \ |
|
| $io | \ |
|
public function activate(Composer $composer, IOInterface $io): void
{
// do nothing
}
| public void deactivate ( \ | ||
| $composer | \ |
|
| $io | \ |
|
public function deactivate(Composer $composer, IOInterface $io): void
{
// do nothing
}
| public array getCapabilities ( ) |
public function getCapabilities(): array
{
return [CommandProvider::class => ConfigCommandProvider::class];
}
| public static array getSubscribedEvents ( ) |
public static function getSubscribedEvents(): array
{
return [
PluginEvents::COMMAND => 'onCommand',
ScriptEvents::POST_AUTOLOAD_DUMP => 'onPostAutoloadDump',
ScriptEvents::POST_INSTALL_CMD => 'onPostUpdateCommandDump',
ScriptEvents::POST_UPDATE_CMD => 'onPostUpdateCommandDump',
];
}
| public void onCommand ( \ | ||
| $event | \ |
|
public function onCommand(CommandEvent $event): void
{
if ($event->getCommandName() === 'dump-autoload') {
$this->runOnAutoloadDump = true;
}
}
| public void onPostAutoloadDump ( \ | ||
| $event | \ |
|
public function onPostAutoloadDump(Event $event): void
{
if ($this->runOnAutoloadDump) {
$this->processConfigs($event->getComposer());
}
}
| public void onPostUpdateCommandDump ( \ | ||
| $event | \ |
|
public function onPostUpdateCommandDump(Event $event): void
{
$this->processConfigs($event->getComposer());
}
User Contributed Notes
Leave a comment
Join the conversation to share a note.