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