mirror of
https://github.com/laravel/valet.git
synced 2026-02-04 08:10:07 +01:00
Set the $_SERVER['SCRIPT_FILENAME'] to the front controller path
This commit is contained in:
@@ -21,12 +21,12 @@ function show_valet_404()
|
|||||||
* Show directory listing or 404 if directory doesn't exist.
|
* Show directory listing or 404 if directory doesn't exist.
|
||||||
*/
|
*/
|
||||||
function show_directory_listing($valetSitePath, $uri)
|
function show_directory_listing($valetSitePath, $uri)
|
||||||
{
|
{
|
||||||
$is_root = ($uri == '/');
|
$is_root = ($uri == '/');
|
||||||
$directory = ($is_root) ? $valetSitePath : $valetSitePath.$uri;
|
$directory = ($is_root) ? $valetSitePath : $valetSitePath.$uri;
|
||||||
|
|
||||||
if (!file_exists($directory)) {
|
if (!file_exists($directory)) {
|
||||||
show_valet_404();
|
show_valet_404();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sort directories at the top
|
// Sort directories at the top
|
||||||
@@ -232,4 +232,5 @@ function get_valet_site_path($valetConfig, $siteName, $domain)
|
|||||||
|
|
||||||
chdir(dirname($frontControllerPath));
|
chdir(dirname($frontControllerPath));
|
||||||
|
|
||||||
|
$_SERVER['SCRIPT_FILENAME'] = $frontControllerPath;
|
||||||
require $frontControllerPath;
|
require $frontControllerPath;
|
||||||
|
|||||||
Reference in New Issue
Block a user