Skip to content

Instantly share code, notes, and snippets.

@ivoba
Created May 23, 2012 13:16
Show Gist options
  • Select an option

  • Save ivoba/2775189 to your computer and use it in GitHub Desktop.

Select an option

Save ivoba/2775189 to your computer and use it in GitHub Desktop.
Tweaked Symfony2 bootstrap file
<?php
/**
* Tweaked Symfony2 bootstrap file
*/
// if you don't want to setup permissions the proper way, just uncomment the following PHP line
// read http://symfony.com/doc/current/book/installation.html#configuration-and-setup for more information
umask(0000);
if ( file_exists( dirname(__FILE__).'/../.env.php' ) ){
$env = require_once( dirname(__FILE__).'/../.env.php' );
}
$env = isset( $env )? $env : 'prod';
$debug = true;
if($env == 'prod'){
$debug = false;
}
require_once __DIR__.'/../app/bootstrap.php.cache';
require_once __DIR__.'/../app/AppKernel.php';
use Symfony\Component\HttpFoundation\Request;
$kernel = new AppKernel($env, $debug);
$kernel->loadClassCache();
if( $env != 'dev' ){
//require_once __DIR__.'/../app/AppCache.php';
//$kernel = new AppCache($kernel);
}
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment