Skip to content

Commit f09e5a0

Browse files
committed
Set the $_SERVER['SCRIPT_FILENAME'] to the front controller path
1 parent f1c1400 commit f09e5a0

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

server.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ function show_valet_404()
2121
* Show directory listing or 404 if directory doesn't exist.
2222
*/
2323
function show_directory_listing($valetSitePath, $uri)
24-
{
24+
{
2525
$is_root = ($uri == '/');
2626
$directory = ($is_root) ? $valetSitePath : $valetSitePath.$uri;
2727

28-
if (!file_exists($directory)) {
29-
show_valet_404();
28+
if (!file_exists($directory)) {
29+
show_valet_404();
3030
}
3131

3232
// Sort directories at the top
@@ -232,4 +232,5 @@ function get_valet_site_path($valetConfig, $siteName, $domain)
232232

233233
chdir(dirname($frontControllerPath));
234234

235+
$_SERVER['SCRIPT_FILENAME'] = $frontControllerPath;
235236
require $frontControllerPath;

0 commit comments

Comments
 (0)