move front controller to web directory
This commit is contained in:
17
web/index.php
Normal file
17
web/index.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Thelia\Core\Thelia;
|
||||
|
||||
//use Symfony\Component\DependencyInjection;
|
||||
|
||||
$env = 'prod';
|
||||
require __DIR__ . '/../core/bootstrap.php';
|
||||
|
||||
$request = Request::createFromGlobals();
|
||||
|
||||
$thelia = new Thelia($env, false);
|
||||
|
||||
$response = $thelia->handle($request)->prepare($request)->send();
|
||||
|
||||
$thelia->terminate($request, $response);
|
||||
26
web/index_dev.php
Normal file
26
web/index_dev.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Thelia\Core\Thelia;
|
||||
|
||||
//use Symfony\Component\DependencyInjection;
|
||||
|
||||
$env = 'dev';
|
||||
require __DIR__ . '/../core/bootstrap.php';
|
||||
|
||||
$trustIp = array(
|
||||
'::1',
|
||||
'127.0.0.1'
|
||||
);
|
||||
|
||||
$request = Request::createFromGlobals();
|
||||
|
||||
if ( false === in_array($request->getClientIp(), $trustIp)) {
|
||||
//change request to send to a 404 error page
|
||||
}
|
||||
|
||||
$thelia = new Thelia($env, true);
|
||||
|
||||
$response = $thelia->handle($request)->prepare($request)->send();
|
||||
|
||||
$thelia->terminate($request, $response);
|
||||
Reference in New Issue
Block a user