You are here

public function MergePlugin::onInstallUpdateOrDump in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/wikimedia/composer-merge-plugin/src/MergePlugin.php \Wikimedia\Composer\MergePlugin::onInstallUpdateOrDump()

Handle an event callback for an install, update or dump command by checking for "merge-plugin" in the "extra" data and merging package contents if found.

Parameters

Event $event:

File

vendor/wikimedia/composer-merge-plugin/src/MergePlugin.php, line 144

Class

MergePlugin
Composer plugin that allows merging multiple composer.json files.

Namespace

Wikimedia\Composer

Code

public function onInstallUpdateOrDump(Event $event) {
  $this->state
    ->loadSettings();
  $this->state
    ->setDevMode($event
    ->isDevMode());
  $this
    ->mergeFiles($this->state
    ->getIncludes(), false);
  $this
    ->mergeFiles($this->state
    ->getRequires(), true);
  if ($event
    ->getName() === ScriptEvents::PRE_AUTOLOAD_DUMP) {
    $this->state
      ->setDumpAutoloader(true);
    $flags = $event
      ->getFlags();
    if (isset($flags['optimize'])) {
      $this->state
        ->setOptimizeAutoloader($flags['optimize']);
    }
  }
}