#!/usr/bin/env php
<?php

/*
 * This file is part of the ddd-symfony package.
 *
 * (c) Beñat Espiña <benatespina@gmail.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Debug\Debug;
use Symfony\Component\Yaml\Yaml;

set_time_limit(0);

require_once __DIR__ . '/../../../../vendor/autoload.php';
require_once __DIR__ . '/AppKernel.php';

$parameters = Yaml::parse(__DIR__ . '/../../../../parameters.yml');
$symfony = $parameters['parameters']['symfony'];

$input = new ArgvInput();

if ($debug = (bool)$symfony['debug']) {
    Debug::enable();
}

$kernel = new AppKernel($symfony['env'], $debug);
$application = new Application($kernel);
$application->run($input);
