mirror of
https://github.com/laravel/valet.git
synced 2026-02-04 16:10:08 +01:00
Fire the .valet-env environment var detection earlier
To support smarter detection of static-file detection and allow Valet to mutate the URI for externally-hosted assets (save bandwidth and local storage etc), detecting any custom-inserted environment variables needs to happen slightly sooner in the execution cycle. Discovered this issue when troubleshooting #729 and #247. While they have other workarounds, this PR simplifies things, and potentially makes custom drivers slightly easier too ... when the use-case applies.
This commit is contained in:
14
server.php
14
server.php
@@ -121,6 +121,13 @@ function valet_default_site_path($config)
|
||||
$_SERVER['HTTP_X_FORWARDED_HOST'] = $_SERVER['HTTP_X_ORIGINAL_HOST'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Attempt to load server environment variables.
|
||||
*/
|
||||
$valetDriver->loadServerEnvironmentVariables(
|
||||
$valetSitePath, $siteName
|
||||
);
|
||||
|
||||
/**
|
||||
* Allow driver to mutate incoming URL.
|
||||
*/
|
||||
@@ -135,13 +142,6 @@ function valet_default_site_path($config)
|
||||
return $valetDriver->serveStaticFile($staticFilePath, $valetSitePath, $siteName, $uri);
|
||||
}
|
||||
|
||||
/**
|
||||
* Attempt to load server environment variables.
|
||||
*/
|
||||
$valetDriver->loadServerEnvironmentVariables(
|
||||
$valetSitePath, $siteName
|
||||
);
|
||||
|
||||
/**
|
||||
* Attempt to dispatch to a front controller.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user