Skip to content

Commit dbf8f0b

Browse files
committed
Move fixing the SCRIPT_FILENAME from server.php to the SymfonyValetDriver.php
1 parent f09e5a0 commit dbf8f0b

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

cli/drivers/SymfonyValetDriver.php

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,17 @@ public function isStaticFile($sitePath, $siteName, $uri)
4747
*/
4848
public function frontControllerPath($sitePath, $siteName, $uri)
4949
{
50-
if (file_exists($frontControllerPath = $sitePath.'/web/app_dev.php')) {
51-
return $frontControllerPath;
52-
} elseif (file_exists($frontControllerPath = $sitePath.'/web/app.php')) {
53-
return $frontControllerPath;
54-
} elseif (file_exists($frontControllerPath = $sitePath.'/public/index.php')) {
55-
return $frontControllerPath;
50+
$frontControllerPath = null;
51+
52+
if (file_exists($path = $sitePath.'/web/app_dev.php')) {
53+
$frontControllerPath = $path;
54+
} elseif (file_exists($path = $sitePath.'/web/app.php')) {
55+
$frontControllerPath = $path;
56+
} elseif (file_exists($path = $sitePath.'/public/index.php')) {
57+
$frontControllerPath = $path;
5658
}
59+
60+
$_SERVER['SCRIPT_FILENAME'] = $frontControllerPath;
61+
return $frontControllerPath;
5762
}
5863
}

server.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,5 +232,4 @@ function get_valet_site_path($valetConfig, $siteName, $domain)
232232

233233
chdir(dirname($frontControllerPath));
234234

235-
$_SERVER['SCRIPT_FILENAME'] = $frontControllerPath;
236235
require $frontControllerPath;

0 commit comments

Comments
 (0)