dev-master
9999999-devProvides Symfony/Console to Silex application
MIT
The Requires
by Kazuyuki Hayashi
Wallogit.com
2017 © Pedro Peláez
Provides Symfony/Console to Silex application
console.options (optional): Array of Options, (*1)
These options are available:, (*2)
console.commands (optional): Array of command (instance of Symfony/Console/Command), (*3)
Symfony\Component\Console\Application
app/bootstrap.php, (*4)
``` php <?php, (*5)
use KzykHys\Silex\Provider\Console\ConsoleServiceProvider;, (*6)
$app = new \Silex\Appliation();, (*7)
return $app;, (*8)
app/console.php ``` php <?php use KzykHys\Silex\Provider\Console\ConsoleServiceProvider; $app = require __DIR__ . '/bootstrap.php'; $app->register(new ConsoleServiceProvider()); $app['console.commands'] = $app->share($app->extend('console.commands', function (array $commands) { $commands[] = new YourCommand(); return $commands; })); $app->boot(); $app['console']->run();
$ php app/console.php
``` php <?php, (*9)
use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface;, (*10)
class YourCommand extends Command {, (*11)
protected function execute(InputInterface $input, OutputInterface $output)
{
/* @var \Silex\Application $app */
$app = $this->getHelper('silex')->getApplication();
}
} ```, (*12)
KzykHys/DoctrineORMServiceProvider Provides DoctrineORM to Silex application (and Doctrine Commands), (*13)
KzykHys/SilexDistribution Configured set of Silex, (*14)
The MIT License, (*15)
Provides Symfony/Console to Silex application
MIT