forked from Sylius/Sylius
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
45 additions
and
191 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
use App\Kernel; | ||
use Symfony\Component\Debug\Debug; | ||
use Symfony\Component\Dotenv\Dotenv; | ||
use Symfony\Component\HttpFoundation\Request; | ||
|
||
require __DIR__.'/../vendor/autoload.php'; | ||
|
||
// The check is to ensure we don't use .env in production | ||
if (!isset($_SERVER['APP_ENV'])) { | ||
if (!class_exists(Dotenv::class)) { | ||
throw new \RuntimeException('APP_ENV environment variable is not defined. You need to define environment variables for configuration or add "symfony/dotenv" as a Composer dependency to load variables from a .env file.'); | ||
} | ||
(new Dotenv())->load(__DIR__.'/../.env'); | ||
} | ||
|
||
$env = $_SERVER['APP_ENV'] ?? 'dev'; | ||
$debug = (bool) ($_SERVER['APP_DEBUG'] ?? ('prod' !== $env)); | ||
|
||
if ($debug) { | ||
umask(0000); | ||
|
||
Debug::enable(); | ||
} | ||
|
||
if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? false) { | ||
Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST); | ||
} | ||
|
||
if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? false) { | ||
Request::setTrustedHosts(explode(',', $trustedHosts)); | ||
} | ||
|
||
$kernel = new Kernel($env, $debug); | ||
$request = Request::createFromGlobals(); | ||
$response = $kernel->handle($request); | ||
$response->send(); | ||
$kernel->terminate($request, $response); |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.