Commit cdbfe49b authored by totten's avatar totten

Restore web/app_dev.php

This file is important in development because it skips the Twig caches.

It has a built-in check to only respond to localhost requests.

All our other Symfony-based backend services include this file in the git repo.
parent d2490776
......@@ -18,5 +18,4 @@
#not sure how else to ensure that the following two files aren't deployed on prod
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Debug\Debug;
// If you don't want to setup permissions the proper way, just uncomment the following PHP line
// read
// for more information
// 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'])
|| !(in_array(@$_SERVER['REMOTE_ADDR'], ['', 'fe80::1', '::1']) || php_sapi_name() === 'cli-server')
) {
header('HTTP/1.0 403 Forbidden');
exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');
* @var Composer\Autoload\ClassLoader $loader
$loader = require __DIR__.'/../app/autoload.php';
$kernel = new AppKernel('dev', true);
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$kernel->terminate($request, $response);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment