onPackageAfterExecute

@param Event $event

@return  void
167662
public function onPackageAfterExecute(Event $event)
    {
        /**
         * @var AbstractPackage    $package
         * @var AbstractController $controller
         */
        $package    = $event['package'];
        $controller = $event['controller'];

        /**
         * @var Container $container
         * @var Collector $collector
         * @var Profiler  $profiler
         */
        $container = $package->getContainer();
        $collector = $container->get('debugger.collector');
        $profiler  = $container->get('profiler');

        $collector['controller.main'] = get_class($controller);

        $collector->push('controller.executed', [
            'controller' => get_class($controller),
            'task' => $event['task'],
            'input' => $controller->getInput()->toArray(),
            'variables' => $event['variables'],
        ]);

        $name = $package->getName();

        $profiler->mark(__FUNCTION__ . ' / ' . $name . ' (' . uniqid() . ')', [
            'tag' => 'package.process',
        ]);
    }
804075
protected function handle(Event $event)
    {
        $method = $this->getApplyMethod($event);
        if (!method_exists($this, $method)) {
            return;
        }
        $this->$method($event);
    }
1117275
public function afterSave($event)
    {
        foreach ($this->relationKey as $from => $to) {
            $this->_relation[$to] = $this->owner[$from];
        }
        $this->_relation->save();
    }
1290609
public static function postPackageUpdate(PackageEvent $event){
		$installedPackage = $event->getOperation()->getTargetPackage()->getName();
		if (self::checkConfig($event, $installedPackage)) {
			self::phinxMigrateFromPackageName($event, $installedPackage);
		} else {
			die();
		}
	}
1080875
public function onAfterRespond(Event $event)
    {
        /** @var ResponseInterface $response */
        $response = $event['response'];

        if (strpos($response->getHeaderLine('Content-Type'), 'html') === false) {
            DebuggerHelper::disableConsole();
        }
    }
1074832
public function afterHandle($event)
    {
        parent::afterHandle($event);
        
        // reset form_token
        if ($this->request->getMethod() === 'POST') {
            
            if ($this->errorInfo && !$this->errorInfo['errcode'] && $this->options['csrfTokenEnabled'] && $this->options['csrfTokenAutoReset']) {
                $this->resetCsrfToken();
            }
        }
    }
502759
public function onFind($event)
    {
        if ($this->isAttributeWriteable($event) && $this->onBeforeFind($event)) {
            if ($this->i18n) {
                $event->sender->setAttribute($this->name, $this->i18nDecodedGetActive($this->i18nFieldDecode($event->sender->getAttribute($this->name), $this->i18nEmptyValue)));
            }
            
            $this->onAfterFind($event);
        }
    }
972468
public function onBeforeSend(Event $event)
    {
        /** @var \Guzzle\Http\Message\Request $request */
        $request = $event['request'];

        list($newUrl, $port) = $this->proxify(
            $request->getUrl(),
            $this->bucketKey,
            $this->gatewayHost
        );

        $request->setUrl($newUrl);

        if ($port) {
            $request->setHeader('Runscope-Request-Port', $port);
        }

        if ($this->authToken) {
            $request->setHeader('Runscope-Bucket-Auth', $this->authToken);
        }
    }
1098586
public function onPostInstallCmd(Event $event)
    {
        $this->bridgeFactory->createBridge($event->getIO())
            ->install($event->getComposer(), $event->isDevMode());
    }
618460
public function afterStore(Event $event) {
		$this->pathBuilder($event->getSubject()->pathBuilder());
		$this->subject = $event->getSubject();

		$this->autoProcessImageVersions($event->getData('entity'), 'create');
	}
1227246
public function publishFiles(Event $event)
    {
        $cmd = $this->composer->getPackage()->getExtra()[self::PUBLISH_CMD] ?? null;

        if ($cmd === null) {
            return;
        }

        $packages = $this->composer->getRepositoryManager()->getLocalRepository()->getCanonicalPackages();

        foreach ($packages as $package) {
            $publish = $package->getExtra()[self::PUBLISH_KEY] ?? null;

            if (empty($publish)) {
                continue;
            }

            foreach ($publish as $data => $options) {
                $this->publish(
                    $cmd,
                    $this->composer->getInstallationManager()->getInstallPath($package),
                    $data,
                    $options
                );
            }
        }
    }
490295
public function postPackageInstall(PackageEvent $event)
    {
        /** @var InstallOperation $operation */
        $operation = $event->getOperation();
        $package = $operation->getPackage();

        if (!$this->guardIsGrumPhpPackage($package)) {
            return;
        }

        // Schedule init when command is completed
        $this->configureScheduled = true;
        $this->initScheduled = true;
    }
181925
public function postOperation(Event $event)
    {
        $this->refreshPatchCollection();
        $patchCollection = $this->getPatchCollection();
        if ($patchCollection->isEmpty()) {
            $this->io->write('<info>No patches supplied.</info>');

            return;
        }
        $packages = $this->getLocalRepositoryPackages();
        foreach ($packages as $package) {
            if ($this->mustInstallPatchesForPackage($package)) {
                $this->installPatchesForPackage($package);
            }
        }
    }
1337697
public static function execute(Event $event) {
    $io = $event->getIO();

    // Search upwards for a composer.json which depends on acquia/lightning.
    $io->write('Searching for root package...');

    $file = static::getRootPackage();

    $package = $file->read();

    // Add the Asset Packagist repository if it does not already exist.
    if (isset($package['repositories'])) {
      $repository_key = NULL;

      foreach ($package['repositories'] as $key => $repository) {
        if ($repository['type'] == 'composer' && strpos($repository['url'], 'https://asset-packagist.org') === 0) {
          $repository_key = $key;
          break;
        }
      }

      if (is_null($repository_key)) {
        $package['repositories']['asset-packagist'] = [
          'type' => 'composer',
          'url' => 'https://asset-packagist.org',
        ];
      }
    }

    // oomphinc/composer-installers-extender is required by Lightning and
    // depends on composer/installers, so it does not need to be specifically
    // included.
    unset(
      $package['require']['composer/installers'],
      $package['require']['oomphinc/composer-installers-extender']
    );

    $package['extra']['installer-types'][] = 'bower-asset';
    $package['extra']['installer-types'][] = 'npm-asset';
    $package['extra']['installer-paths']['docroot/libraries/{$name}'][] = 'type:bower-asset';
    $package['extra']['installer-paths']['docroot/libraries/{$name}'][] = 'type:npm-asset';

    $file->write($package);
    $io->write('Successfully updated your root composer.json file. Switch back to your project root and run "composer update".');
  }
564525
protected function handle(Event $event): void
    {
        $method = 'apply'.ClassName::short($event);

        if (!method_exists($this, $method)) {
            return;
        }

        $this->$method($event);
    }
192185
public static function Go(Event $event)
    {
        $event->getIO()->writeError('<info>Updating .gitignore: </info>', false);

        $composer = $event->getComposer();
        $repositoryManager = $composer->getRepositoryManager();
        $installManager = $composer->getInstallationManager();
        $extraConfiguration = $composer->getPackage()->getExtra();

        // Check in composer extra configuration if devOnly option is set
        $devRequires = (array_key_exists('autogitignore', $extraConfiguration)
            && $extraConfiguration['autogitignore'] == 'devOnly');

        // If devOnly option is set
        if ($devRequires) {
            // Grab original list of all require-dev packages
            $devRequires = array_keys($composer->getPackage()->getDevRequires());
            // Grab original list of all require packages
            $requires = array_keys($composer->getPackage()->getRequires());

            // Grab recursively require and require-dev packages
            foreach ($repositoryManager->getLocalRepository()->getPackages() as $package) {
                $devRequires = array_merge($devRequires, array_keys($package->getDevRequires()));
                $requires = array_merge($requires, array_keys($package->getRequires()));
            }

            // Remove duplicates
            $devRequires = array_unique($devRequires);
            $requires = array_unique($requires);

            // Sort packages
            sort($devRequires);
            sort($requires);
        }

        $packages = array();
        foreach ($repositoryManager->getLocalRepository()->getPackages() as $package) {
            // Test if we need to ignore the package
            // If the option devOnly is set, we check that
            // the package is not in the list of require-dev
            // OR is set in the list of require packages
            // before skipping.
            if ($devRequires && (!in_array($package->getName(), $devRequires) || in_array($package->getName(), $requires))) {
                continue;
            }
            $path = $installManager->getInstallPath($package);
            $packages[] = '/' . preg_replace('~^' . preg_quote(str_replace('\\', '/', getcwd()) . '/') . '~', '', str_replace('\\', '/', realpath($path))) . '/';
        }

        $packages = array_unique($packages);
        sort($packages);

        try {
            $gitIgnoreFile = GitIgnoreFile::create(getcwd() . DIRECTORY_SEPARATOR . '.gitignore');
            $gitIgnoreFile->setLines($packages);
            $gitIgnoreFile->save();
        } catch (Exception $exception) {
            $event->getIO()->writeError('<info>Failed - ' . $exception->getMessage() . '</info>');

            return false;
        }

        $event->getIO()->writeError('<info>Done - ' . count($packages) . ' packages ignored.</info>');

        return true;
    }
661375
public function copyProjectExtraFiles(Event $event): void
    {
        $extras = $event->getComposer()->getPackage()->getExtra();
        if (array_key_exists('copy-files', $extras)) {
            $this->installer->getIo()->write(
                sprintf('  - Copied additional file(s)'),
                true
            );
            $this->copyExtras($extras['copy-files']);
        }
    }