You are here

public function MergePlugin::onPostPackageInstall in Zircon Profile 8.0

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

Handle an event callback following installation of a new package by checking to see if the package that was installed was our plugin.

Parameters

PackageEvent $event:

File

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

Class

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

Namespace

Wikimedia\Composer

Code

public function onPostPackageInstall(PackageEvent $event) {
  $op = $event
    ->getOperation();
  if ($op instanceof InstallOperation) {
    $package = $op
      ->getPackage()
      ->getName();
    if ($package === self::PACKAGE_NAME) {
      $this->logger
        ->info('composer-merge-plugin installed');
      $this->state
        ->setFirstInstall(true);
      $this->state
        ->setLocked($event
        ->getComposer()
        ->getLocker()
        ->isLocked());
    }
  }
}