Handle an event callback following an install or update command. If our
plugin was installed during the run then trigger an update command to
process any merge-patterns in the current config.

@param ScriptEvent $event
324410
public function onPostInstallOrUpdate(ScriptEvent $event)
    {
        // @codeCoverageIgnoreStart
        if ($this->state->isFirstInstall()) {
            $this->state->setFirstInstall(false);
            $this->logger->info(
                '<comment>' .
                'Running additional update to apply merge settings' .
                '</comment>'
            );

            $config = $this->composer->getConfig();

            $preferSource = $config->get('preferred-install') == 'source';
            $preferDist = $config->get('preferred-install') == 'dist';

            $installer = Installer::create(
                $event->getIO(),
                // Create a new Composer instance to ensure full processing of
                // the merged files.
                Factory::create($event->getIO(), null, false)
            );

            $installer->setPreferSource($preferSource);
            $installer->setPreferDist($preferDist);
            $installer->setDevMode($event->isDevMode());
            $installer->setDumpAutoloader($this->state->shouldDumpAutoloader());
            $installer->setOptimizeAutoloader(
                $this->state->shouldOptimizeAutoloader()
            );

            if ($this->state->forceUpdate()) {
                // Force update mode so that new packages are processed rather
                // than just telling the user that composer.json and
                // composer.lock don't match.
                $installer->setUpdate(true);
            }

            $installer->run();
        }
        // @codeCoverageIgnoreEnd
    }
156691
public static function rootInstall(Event $event)
    {
        include getcwd() . '/vendor/autoload.php';

        $io = $event->getIO();

        static::genSecretCode($io);

        static::genSecretConfig($io);

        // Complete
        $io->write('Install complete.');
    }
1010084
public function onPostAutoloadDump(Event $event)
    {
        $this->io->overwriteError('<info>Assembling config files</info>');

        $this->builder = new Builder();

        $this->initAutoload();
        $this->scanPackages();
        $this->reorderFiles();
        $this->showDepsTree();

        $this->builder->buildAllConfigs($this->files);
    }
397477
public function on($event, Closure $callback)
    {
        if (!in_array($event, ['*', 'modify', 'delete', 'create'])) {
            throw new RuntimeException('Could not bind to unknown event '.$event);
        }

        $this->registerBinding($event, $callback);
    }
402916
@EventHandler("command")
    private void onCommand(CommandEvent event) {
        if (isEnabled()) {
            for (BaseComponent child : container.getChildren()) {
                EventUtil.send(event, child);

                if (event.isStopped()) {
                    break;
                }
            }
        }
    }
273352
public function run(ScriptEvent $event): bool
    {
        if (!$this->shouldRun($event)) {
            return true;
        }
        $io = $event->getIO();
        $io->writeError('');
        $io->writeError('<info>Setting up TYPO3</info>');

        $consoleIO = new ConsoleIo($event->getIO());
        $this->ensureTypo3Booted();
        $commandDispatcher = CommandDispatcher::createFromComposerRun($event);
        $setup = new CliSetupRequestHandler(
            new ConsoleOutput($consoleIO->getOutput(), $consoleIO->getInput()),
            $commandDispatcher
        );
        $setup->setup($consoleIO->isInteractive(), $this->populateCommandArgumentsFromEnvironment());
        putenv('TYPO3_IS_SET_UP=1');

        $installedFileContent = '';
        if ($this->isDotEnvEnabled) {
            $installedFileContent .= 'TYPO3_CONTEXT=Development' . chr(10);
        }
        file_put_contents($this->installedFile, $installedFileContent);

        return true;
    }
1293842
public function handle(Event $event)
    {
        $name = $event->getName();
        $emitter = $event->getEmitter();
        $emitter->removeListener($name, $this);

        unset($name, $emitter);

        call_user_func_array($this->handler, [$event]);
    }
209013
public function handle(EventInterface $event)
    {

        try {
            // load the application server and the naming directory instance
            /** @var \AppserverIo\Psr\ApplicationServer\ApplicationServerInterface $applicationServer */
            $applicationServer = $this->getApplicationServer();
            /** @var \AppserverIo\Psr\Naming\NamingDirectoryInterface $namingDirectory */
            $namingDirectory = $applicationServer->getNamingDirectory();

            // load the configuration filename
            $configurationFilename = $applicationServer->getConfigurationFilename();

            // write a log message that the event has been invoked
            $applicationServer->getSystemLogger()->info($event->getName());

            // load the setup mode from the naming directory
            $setupMode = $namingDirectory->search('php:env/args/s');
            $currentUser = $namingDirectory->search('php:env/currentUser');

            // load the service instance and switch to the new setup mode
            /** @var \AppserverIo\Appserver\Core\Api\ContainerService $service */
            $service = $applicationServer->newService('AppserverIo\Appserver\Core\Api\ContainerService');
            $service->switchSetupMode($setupMode, $configurationFilename, $currentUser);

        } catch (NamingException $ne) {
            $applicationServer->getSystemLogger()->error('Please specify a setup mode, e. g. \'./server.php -s prod\'');
        } catch (\Exception $e) {
            $applicationServer->getSystemLogger()->error($e->__toString());
        }
    }
328945
public function handle($event, $args) {
		if (isset($this->callback[$event])) {
			$this->callback[$event](...$args);
		}
	}
930675
public function handle(EventMessage $event)
    {
        if ($event instanceof \PAMI\Message\Event\AsyncAGIEvent) {
            if ($event->getCommandId() == $this->lastCommandId) {
                $this->lastAgiResult = trim($event->getResult());
            }
        }
    }
1279091
public static function notifyProjectInstall(Event $event)
    {
        self::getContainer()->addJob(new InstalledProjectNotify($event->getComposer()->getPackage()));
    }
955190
protected function execute($event)
    {
        foreach($this->events[$event] as $handler) {
            $this->listen($event, $handler);
        }
    }
31907
public function handle($event)
    {
        if ($event instanceof RouteMatched) {
            $this->handleLaravelRoute($event);
        }

        if ($event instanceof GzeroRouteMatched) {
            $this->handleRoute($event);
        }
    }
532339
public function onPostUpdateCmd(Event $event)
    {
        $this->bridgeFactory->createBridge($event->getIO())
            ->update($event->getComposer());
    }
830481
protected function fireEvent($event)
    {
        $this->app['events']->fire(sprintf('modules.%s.'.$event, $this->getLowerName()), [$this]);
    }
234296
private function fireEvent($event, ...$params)
    {
        if (!$this->eventManager) {
            return;
        }

        $this->eventManager->handle($event, ...$params);
    }
1310723
private function fireEvent($event)
    {
        $env = $this->formatEventName($event);

        if (emitter()->bound($env)) {
            emitter()->emit($env, $this);
        }
    }