Issues (42)

web/app_dev.php (1 issue)

1
<?php
2
3
/*
4
 * This file is part of the Veslo project <https://github.com/symfony-doge/veslo>.
5
 *
6
 * (C) 2019 Pavel Petrov <[email protected]>.
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 *
11
 * @license https://opensource.org/licenses/GPL-3.0 GPL-3.0
12
 */
13
14
declare(strict_types=1);
15
16
use Symfony\Component\Debug\Debug;
17
use Symfony\Component\Dotenv\Dotenv;
18
use Symfony\Component\HttpFoundation\Request;
19
20
// If you don't want to setup permissions the proper way, just uncomment the following PHP line
21
// read https://symfony.com/doc/current/setup.html#checking-symfony-application-configuration-and-setup
22
// for more information
23
//umask(0000);
24
25
// This check prevents access to debug front controllers that are deployed by accident to production servers.
26
// Feel free to remove this, extend it, or make something more sophisticated.
27
if (!getenv('APP_DEBUG')) {
28
    header('HTTP/1.0 403 Forbidden');
29
    exit('You are not allowed to access this file. Check ' . basename(__FILE__) . ' for more information.');
30
}
31
32
require __DIR__ . '/../vendor/autoload.php';
33
34
Debug::enable();
35
36
if (!isset($_SERVER['APP_ENV'])) {
37
    if (!class_exists(Dotenv::class)) {
38
        throw new \RuntimeException(
39
            'APP_ENV environment variable is not defined.'
40
            . ' You need to define environment variables for configuration or add "symfony/dotenv"'
41
            . ' as a Composer dependency to load variables from a .env file.'
42
        );
43
    }
44
    (new Dotenv())->load(__DIR__ . '/../.env');
45
}
46
47
$kernel = new AppKernel($_SERVER['APP_ENV'], true);
48
if (PHP_VERSION_ID < 70000) {
49
    $kernel->loadClassCache();
0 ignored issues
show
Deprecated Code introduced by
The function Symfony\Component\HttpKe...ernel::loadClassCache() has been deprecated: since version 3.3, to be removed in 4.0. The class cache is not needed anymore when using PHP 7.0. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

49
    /** @scrutinizer ignore-deprecated */ $kernel->loadClassCache();

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
50
}
51
52
$request  = Request::createFromGlobals();
53
$response = $kernel->handle($request);
54
$response->send();
55
$kernel->terminate($request, $response);
56