Skip to content

Instantly share code, notes, and snippets.

@EdwardIII
Created October 10, 2014 15:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EdwardIII/be42ad2ff73b0ff02416 to your computer and use it in GitHub Desktop.
Save EdwardIII/be42ad2ff73b0ff02416 to your computer and use it in GitHub Desktop.
<?php
use Symfony\Component\ClassLoader\ApcClassLoader;
use Symfony\Component\Debug\Debug;
use Symfony\Component\HttpFoundation\Request;
$loader = require_once __DIR__.'/../app/bootstrap.php.cache';
// Use APC for autoloading to improve performance.
// Change 'sf2' to a unique prefix in order to prevent cache key conflicts
// with other applications also using APC.
/*
$apcLoader = new ApcClassLoader('sf2', $loader);
$loader->unregister();
$apcLoader->register(true);
*/
// Allow switching between env and debug using env vars
// In apache, switch by setting this in the site's
// vhost:
// SetEnv SYMFONY_ENV dev
// SetEnv SYMFONY_DEBUG 1
// Can be dev, test or prod
$env = getenv('SYMFONY_ENV') ?: 'prod';
$debug = getenv('SYMFONY_DEBUG') === '1';
if ($debug) {
Debug::enable();
}
require_once __DIR__.'/../app/AppKernel.php';
//require_once __DIR__.'/../app/AppCache.php';
try {
$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);
}catch(Exception $e){
# Still just seeing:
# [Fri Oct 10 16:08:11 2014] [error] [client 10.13.14.1] PHP Fatal error: Uncaught exception 'Exception' with message 'Serialization of 'SimpleXMLElement' is not allowed' in [no active file]:0\nStack trace:\n#0 [internal function]: session_write_close()\n#1 {main}\n thrown in [no active file] on line 0, referer: <snip>
trigger_error($e->getTraceAsString);
throw $e;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment