run() public method

Executes this application.
public run ( Symfony\Component\Console\Input\InputInterface $input = null, Symfony\Component\Console\Output\OutputInterface $output = null ) : integer
$input Symfony\Component\Console\Input\InputInterface
$output Symfony\Component\Console\Output\OutputInterface
return integer
Ejemplo n.º 1
0
#!/usr/bin/env php
<?php 
if (!($bootstrap = (require_once __DIR__ . '/bootstrap.php'))) {
    die('You must set up the project dependencies.');
}
use Cilex\Application;
use NewsToChat\Command\Maintenance;
use NewsToChat\Command\PushNews;
use NewsToChat\Command\PullNews;
$runtime = new DateTime();
$runtime = $runtime->format('Y-m-d @ H:i:s');
$settings = parse_ini_file(__DIR__ . '/config/settings.ini', true);
$name = $settings['global']['name'];
$sources = $settings['sources'];
$token = $settings['global']['token'];
$version = $settings['global']['version'];
$app = new Application($name, $version);
$app->command(new Maintenance($entityManager, $runtime));
$app->command(new PullNews($entityManager, $runtime, $sources));
$app->command(new PushNews($entityManager, $runtime, $token));
$app->run();
Ejemplo n.º 2
0
 /**
  * Run app
  */
 public function run()
 {
     $this->app->run();
 }