comparison a_dev.php @ 0:493bcb69166c

added public content
author Daniel Wolff
date Tue, 09 Feb 2016 20:54:02 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:493bcb69166c
1 <?php
2
3 use Symfony\Component\HttpFoundation\Request;
4 use Symfony\Component\Debug\Debug;
5
6 // If you don't want to setup permissions the proper way, just uncomment the following PHP line
7 // read http://symfony.com/doc/current/book/installation.html#configuration-and-setup for more information
8 //umask(0000);
9
10 // This check prevents access to debug front controllers that are deployed by accident to production servers.
11 // Feel free to remove this, extend it, or make something more sophisticated.
12 if (isset($_SERVER['HTTP_CLIENT_IP'])
13 || isset($_SERVER['HTTP_X_FORWARDED_FOR'])
14 || (
15 !(in_array(@$_SERVER['REMOTE_ADDR'], array('127.0.0.1', 'fe80::1', '::1')) || php_sapi_name() === 'cli-server')
16 && substr(@$_SERVER['REMOTE_ADDR'], 0, 9) !== '192.168.1'
17 && substr(@$_SERVER['REMOTE_ADDR'], 0, 7) !== '10.209.'
18 )
19 ) {
20 header('HTTP/1.0 403 Forbidden');
21 exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');
22 }
23
24 $loader = require_once __DIR__.'/app/bootstrap.php.cache';
25 Debug::enable();
26
27 require_once __DIR__.'/app/AppKernel.php';
28
29 $kernel = new AppKernel('dev', true);
30 $kernel->loadClassCache();
31 $request = Request::createFromGlobals();
32 $response = $kernel->handle($request);
33 $response->send();
34 $kernel->terminate($request, $response);