Inheritance: extends Symfony\Component\Console\Application
Exemple #1
0
<?php

use App\Console\Application;
use App\Console\Command\ServeCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
$console = new Application($app, 'My Silex Application', 'n/a');
$console->getDefinition()->addOption(new InputOption('--env', '-e', InputOption::VALUE_REQUIRED, 'The Environment name.', 'dev'));
$console->setDispatcher($app['dispatcher']);
$console->add(new ServeCommand());
// Add commands here
return $console;
<?php

/**
 * @author Patsura Dmitry <*****@*****.**>
 */
include_once __DIR__ . '/../vendor/autoload.php';
define('APPLICATION_PATH', realpath(__DIR__));
define('APPLICATION_ENV', getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'development');
use App\Console\Command\SettingsUpdate;
use App\Console\Application;
$config = (include APPLICATION_PATH . "/config/core.php");
$application = new \Phalcony\Application(APPLICATION_ENV, $config, \Phalcon\DI\FactoryDefault\CLI::getDefault());
$application->bootstrap();
$consoleApplication = new Application($application);
$consoleApplication->add(new SettingsUpdate());
$consoleApplication->run();