|
@@ -2,21 +2,27 @@
|
|
|
|
|
|
ini_set('date.timezone', 'UTC');
|
|
|
|
|
|
-// this check prevents access to debug front controllers that are deployed by accident to production servers.
|
|
|
-// feel free to remove this, extend it, or make something more sophisticated.
|
|
|
-if (!in_array(@$_SERVER['REMOTE_ADDR'], array(
|
|
|
- '127.0.0.1',
|
|
|
- '::1',
|
|
|
-))) {
|
|
|
+use Symfony\Component\HttpFoundation\Request;
|
|
|
+
|
|
|
+// This check prevents access to debug front controllers that are deployed by accident to production servers.
|
|
|
+// Feel free to remove this, extend it, or make something more sophisticated.
|
|
|
+if (isset($_SERVER['HTTP_CLIENT_IP'])
|
|
|
+ || isset($_SERVER['HTTP_X_FORWARDED_FOR'])
|
|
|
+ || !in_array(@$_SERVER['REMOTE_ADDR'], array(
|
|
|
+ '127.0.0.1',
|
|
|
+ '::1',
|
|
|
+ ))
|
|
|
+) {
|
|
|
header('HTTP/1.0 403 Forbidden');
|
|
|
- die('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');
|
|
|
+ exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');
|
|
|
}
|
|
|
|
|
|
-require_once __DIR__.'/../app/bootstrap.php.cache';
|
|
|
+$loader = require_once __DIR__.'/../app/bootstrap.php.cache';
|
|
|
require_once __DIR__.'/../app/AppKernel.php';
|
|
|
|
|
|
-use Symfony\Component\HttpFoundation\Request;
|
|
|
-
|
|
|
$kernel = new AppKernel('dev', true);
|
|
|
$kernel->loadClassCache();
|
|
|
-$kernel->handle(Request::createFromGlobals())->send();
|
|
|
+$request = Request::createFromGlobals();
|
|
|
+$response = $kernel->handle($request);
|
|
|
+$response->send();
|
|
|
+$kernel->terminate($request, $response);
|