Pagekit\Application\Console\Application::run PHP Метод

run() публичный Метод

public run ( Symfony\Component\Console\Input\InputInterface $input = null, Symfony\Component\Console\Output\OutputInterface $output = null )
$input Symfony\Component\Console\Input\InputInterface
$output Symfony\Component\Console\Output\OutputInterface
    public function run(InputInterface $input = null, OutputInterface $output = null)
    {
        $code = parent::run($input, $output);
        if ($code === 0 && isset($this->container['events'])) {
            $this->container['events']->trigger(new Event('terminate'));
        }
        return $code;
    }

Usage Example

Пример #1
0
<?php

use Pagekit\Application as App;
use Pagekit\Application\Console\Application as Console;
use Pagekit\Module\Loader\AutoLoader;
use Pagekit\Module\Loader\ConfigLoader;
$loader = (require $path . '/autoload.php');
$app = new App($config);
$app['autoloader'] = $loader;
$app['module']->register(['packages/*/*/index.php', 'app/modules/*/index.php', 'app/installer/index.php', 'app/system/index.php', 'app/console/index.php'], $path);
$app['module']->addLoader(new AutoLoader($app['autoloader']));
$app['module']->addLoader(new ConfigLoader(require $path . '/app/system/config.php'));
if ($app['config.file']) {
    $app['module']->addLoader(new ConfigLoader(require $app['config.file']));
    $app['module']->load('system');
}
$app['module']->load('console');
$console = new Console($app, 'Rimbo', $app->version());
$console->run();