1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* This file is part of the Symfony-Util package. |
5
|
|
|
* |
6
|
|
|
* (c) Jean-Bernard Addor |
7
|
|
|
* |
8
|
|
|
* For the full copyright and license information, please view the LICENSE |
9
|
|
|
* file that was distributed with this source code. |
10
|
|
|
*/ |
11
|
|
|
|
12
|
|
|
use Symfony\Component\Debug\Debug; |
13
|
|
|
use Symfony\Component\HttpFoundation\Request; |
14
|
|
|
|
15
|
|
|
// If you don't want to setup permissions the proper way, just uncomment the following PHP line |
16
|
|
|
// read http://symfony.com/doc/current/setup.html#checking-symfony-application-configuration-and-setup |
17
|
|
|
// for more information |
18
|
|
|
//umask(0000); |
19
|
|
|
|
20
|
|
|
// This check prevents access to debug front controllers that are deployed by accident to production servers. |
21
|
|
|
// Feel free to remove this, extend it, or make something more sophisticated. |
22
|
|
|
if (isset($_SERVER['HTTP_CLIENT_IP']) |
23
|
|
|
|| isset($_SERVER['HTTP_X_FORWARDED_FOR']) |
24
|
|
|
|| !(in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', '::1'], true) || PHP_SAPI === 'cli-server') |
25
|
|
|
) { |
26
|
|
|
header('HTTP/1.0 403 Forbidden'); |
27
|
|
|
exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.'); |
28
|
|
|
} |
29
|
|
|
|
30
|
|
|
chdir('..'); // TODO: is this needed and why? -- to find autoload, kernel.root_dir and config file |
31
|
|
|
|
32
|
|
|
$loader = require 'vendor/autoload.php'; |
33
|
|
|
// $loader = require __DIR__.'/../vendor/autoload.php'; |
34
|
|
|
// require __DIR__.'/../app/u008f_CRUD_FOSUser_DBAL.php'; |
35
|
|
|
// AnnotationRegistry::registerLoader([$loader, 'loadClass']); |
36
|
|
|
|
37
|
|
|
Debug::enable(); |
38
|
|
|
|
39
|
|
|
// require 'tests/FrameworkTwig/src/AppKernel.php'; |
40
|
|
|
require getenv('KERNEL_DIR').'/AppKernel.php'; |
41
|
|
|
|
42
|
|
|
$kernel = new AppKernel('dev', true); |
43
|
|
|
if (PHP_VERSION_ID < 70000) { |
44
|
|
|
$kernel->loadClassCache(); |
|
|
|
|
45
|
|
|
} |
46
|
|
|
$request = Request::createFromGlobals(); |
47
|
|
|
$response = $kernel->handle($request); |
48
|
|
|
$response->send(); |
49
|
|
|
$kernel->terminate($request, $response); |
50
|
|
|
|
This method has been deprecated. The supplier of the class has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.