mirror of
https://github.com/laravel/valet.git
synced 2026-02-06 16:50:09 +01:00
adjust so that server variable doesnt need to be defined in all tests
This commit is contained in:
@@ -20,7 +20,9 @@ public function serves(string $sitePath, string $siteName, string $uri): bool
|
|||||||
*/
|
*/
|
||||||
public function frontControllerPath(string $sitePath, string $siteName, string $uri): string
|
public function frontControllerPath(string $sitePath, string $siteName, string $uri): string
|
||||||
{
|
{
|
||||||
if ($this->isActualFile($staticPath = $this->getStaticPath($sitePath))) {
|
$staticPath = $this->getStaticPath($sitePath);
|
||||||
|
|
||||||
|
if ($staticPath && $this->isActualFile($staticPath)) {
|
||||||
return $staticPath;
|
return $staticPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -30,9 +32,13 @@ public function frontControllerPath(string $sitePath, string $siteName, string $
|
|||||||
/**
|
/**
|
||||||
* Get the path to the static file.
|
* Get the path to the static file.
|
||||||
*/
|
*/
|
||||||
protected function getStaticPath(string $sitePath): string
|
private function getStaticPath(string $sitePath)
|
||||||
{
|
{
|
||||||
$parts = parse_url($_SERVER['REQUEST_URI']);
|
if (! $uri = $_SERVER['REQUEST_URI'] ?? null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$parts = parse_url($uri);
|
||||||
$query = $parts['query'] ?? '';
|
$query = $parts['query'] ?? '';
|
||||||
|
|
||||||
return $sitePath.'/public/static'.$parts['path'].'_'.$query.'.html';
|
return $sitePath.'/public/static'.$parts['path'].'_'.$query.'.html';
|
||||||
|
|||||||
Reference in New Issue
Block a user