1
0
mirror of https://github.com/laravel/valet.git synced 2026-02-04 08:10:07 +01:00

Move fixing the SCRIPT_FILENAME from server.php to the SymfonyValetDriver.php

This commit is contained in:
Jakub Tobiasz
2021-07-04 11:22:01 +02:00
parent f09e5a0c00
commit dbf8f0b89e
2 changed files with 11 additions and 7 deletions

View File

@@ -47,12 +47,17 @@ public function isStaticFile($sitePath, $siteName, $uri)
*/
public function frontControllerPath($sitePath, $siteName, $uri)
{
if (file_exists($frontControllerPath = $sitePath.'/web/app_dev.php')) {
return $frontControllerPath;
} elseif (file_exists($frontControllerPath = $sitePath.'/web/app.php')) {
return $frontControllerPath;
} elseif (file_exists($frontControllerPath = $sitePath.'/public/index.php')) {
return $frontControllerPath;
$frontControllerPath = null;
if (file_exists($path = $sitePath.'/web/app_dev.php')) {
$frontControllerPath = $path;
} elseif (file_exists($path = $sitePath.'/web/app.php')) {
$frontControllerPath = $path;
} elseif (file_exists($path = $sitePath.'/public/index.php')) {
$frontControllerPath = $path;
}
$_SERVER['SCRIPT_FILENAME'] = $frontControllerPath;
return $frontControllerPath;
}
}

View File

@@ -232,5 +232,4 @@ function get_valet_site_path($valetConfig, $siteName, $domain)
chdir(dirname($frontControllerPath));
$_SERVER['SCRIPT_FILENAME'] = $frontControllerPath;
require $frontControllerPath;