示例#1
0
#!/usr/bin/env php
<?php 
use Symfony\Component\Debug\Debug;
require_once __DIR__ . '/../vendor/autoload.php';
$input = new \Symfony\Component\Console\Input\ArgvInput();
$output = new \Symfony\Component\Console\Output\ConsoleOutput();
$env = $input->getParameterOption(array('--env', '-e'), 'cli');
if ($input->hasParameterOption(array('--debug'))) {
    $debug = (bool) $input->getParameterOption(array('--debug'), true);
} else {
    $debug = true;
}
if ($debug) {
    Debug::enable();
}
$app = new SupraApplication($env, $debug);
$container = $app->buildContainer();
$container->getConsole()->run($input, $output);
示例#2
0
<?php

require_once __DIR__ . '/../vendor/autoload.php';
$supra = new SupraApplication('dev', true);
//this should be refactored to single call, for the sake of prettiness
$supra->buildContainer();
$supra->boot();
$response = $supra->handleRequest();
$response->send();
$supra->shutdown();