diff --git a/cli/drivers/SymfonyValetDriver.php b/cli/drivers/SymfonyValetDriver.php index 92d0489..a5c6d15 100644 --- a/cli/drivers/SymfonyValetDriver.php +++ b/cli/drivers/SymfonyValetDriver.php @@ -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; } } diff --git a/server.php b/server.php index d7e6e48..822c979 100644 --- a/server.php +++ b/server.php @@ -232,5 +232,4 @@ function get_valet_site_path($valetConfig, $siteName, $domain) chdir(dirname($frontControllerPath)); -$_SERVER['SCRIPT_FILENAME'] = $frontControllerPath; require $frontControllerPath;