mirror of
https://github.com/symfony/recipes.git
synced 2026-09-12 07:36:30 +03:00
Fix routes support when using the PHP built-in web server
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
* <fg=blue>Run</> your application:
|
||||
1. Change to the project directory
|
||||
2. Create your code repository with the <comment>git init</comment> command
|
||||
3. Execute the <comment>php -S 127.0.0.1:8000 -t public</> command
|
||||
3. Execute the <comment>php -S 127.0.0.1:8000 -t public public/index.php</> command
|
||||
4. Browse to the <comment>http://localhost:8000/</> URL.
|
||||
|
||||
Quit the server with CTRL-C.
|
||||
|
||||
@@ -19,6 +19,10 @@ $env = $_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? 'dev';
|
||||
$debug = (bool) ($_SERVER['APP_DEBUG'] ?? $_ENV['APP_DEBUG'] ?? ('prod' !== $env));
|
||||
|
||||
if ($debug) {
|
||||
// Compatibility with the built-in PHP web server
|
||||
if ('/index.php' !== $_SERVER['SCRIPT_NAME'] && is_file(__DIR__.$_SERVER['SCRIPT_NAME'])) {
|
||||
return false;
|
||||
}
|
||||
umask(0000);
|
||||
|
||||
Debug::enable();
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* <fg=blue>Run</> your application:
|
||||
1. Change to the project directory
|
||||
2. Create your code repository with the <comment>git init</comment> command
|
||||
3. Execute the <comment>php -S 127.0.0.1:8000 -t public</> command
|
||||
3. Execute the <comment>php -S 127.0.0.1:8000 -t public public/index.php</> command
|
||||
4. Browse to the <comment>http://localhost:8000/</> URL.
|
||||
|
||||
Quit the server with CTRL-C.
|
||||
|
||||
@@ -19,6 +19,10 @@ $env = $_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? 'dev';
|
||||
$debug = (bool) ($_SERVER['APP_DEBUG'] ?? $_ENV['APP_DEBUG'] ?? ('prod' !== $env));
|
||||
|
||||
if ($debug) {
|
||||
// Compatibility with the built-in PHP web server
|
||||
if ('/index.php' !== $_SERVER['SCRIPT_NAME'] && is_file(__DIR__.$_SERVER['SCRIPT_NAME'])) {
|
||||
return false;
|
||||
}
|
||||
umask(0000);
|
||||
|
||||
Debug::enable();
|
||||
|
||||
Reference in New Issue
Block a user