Last active
August 29, 2015 14:13
-
-
Save jderusse/63158457a6d04e06a8dc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Symfony\Component\HttpFoundation\Request; | |
use Symfony\Component\Debug\Debug; | |
use Symfony\Component\ClassLoader\ApcClassLoader; | |
$env = getenv('SYMFONY_ENV') ?: 'prod'; | |
$debug = getenv('SYMFONY_DEBUG') === '1'; | |
$loader = require_once __DIR__.'/../app/bootstrap.php.cache'; | |
if ($debug) { | |
Debug::enable(); | |
} | |
if ('prod' === $env) { | |
// Enable APC for autoloading to improve performance. | |
// You should change the ApcClassLoader first argument to a unique prefix | |
// in order to prevent cache key conflicts with other applications | |
// also using APC. | |
/* | |
$apcLoader = new ApcClassLoader(sha1(__FILE__), $loader); | |
$loader->unregister(); | |
$apcLoader->register(true); | |
*/ | |
} else { | |
// 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); | |
} | |
require_once __DIR__.'/../app/AppKernel.php'; | |
$kernel = new AppKernel($env, $debug); | |
$kernel->loadClassCache(); | |
//$kernel = new AppCache($kernel); | |
// When using the HttpCache, you need to call the method in your front controller instead of relying on the configuration parameter | |
//Request::enableHttpMethodParameterOverride(); | |
$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