Daemon application using DIC.

This commit is contained in:
Marco Vito Moscaritolo 2015-05-31 15:06:45 +02:00
parent 56082f201b
commit 4b957e8d5d
3 changed files with 10 additions and 7 deletions

View file

@ -12,9 +12,7 @@ define('PHPCI_IS_CONSOLE', true);
require('bootstrap.php');
use Symfony\Component\Console\Application;
/** @var Application */
/** @var \Symfony\Component\Console\Application */
$application = $container->get('console.application');
$application->run();

View file

@ -12,9 +12,7 @@ define('PHPCI_IS_CONSOLE', true);
require('bootstrap.php');
use PHPCI\Command\DaemoniseCommand;
use Symfony\Component\Console\Application;
/** @var \Symfony\Component\Console\Application */
$application = $container->get('daemon.application');
$application = new Application();
$application->add(new DaemoniseCommand($loggerConfig->getFor('DaemoniseCommand')));
$application->run();

View file

@ -145,6 +145,13 @@ services:
- [add, ['@console.command.poll']]
- [add, ['@console.command.create_admin']]
- [add, ['@console.command.create_build']]
daemon.application:
class: Symfony\Component\Console\Application
arguments:
- %application.name%
- %application.version%
calls:
- [add, ['@console.command.daemon']]
console.logger:
class: Monolog\Logger
arguments: