forked from mautic/mautic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
29 lines (22 loc) · 848 Bytes
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
define('MAUTIC_ROOT_DIR', __DIR__);
// Fix for hosts that do not have date.timezone set, it will be reset based on users settings
date_default_timezone_set('UTC');
require_once 'autoload.php';
$config = include 'app/config/environment.php';
use Mautic\CoreBundle\ErrorHandler\ErrorHandler;
use Mautic\Middleware\MiddlewareBuilder;
use Symfony\Component\HttpFoundation\Request;
ErrorHandler::register($config['env']);
if (
'dev' === strtolower($config['env'])
&& extension_loaded('apcu')
&& in_array(@$_SERVER['REMOTE_ADDR'], $config['dev_ip_whitelist'])
) {
@apcu_clear_cache();
}
$kernel = (new MiddlewareBuilder(new AppKernel($config['env'], $config['debug'])))->resolve();
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);