mirror of
https://github.com/laravel/valet.git
synced 2026-02-07 17:10:05 +01:00
some cleaning
This commit is contained in:
@@ -47,10 +47,6 @@ public function isStaticFile($sitePath, $siteName, $uri)
|
|||||||
*/
|
*/
|
||||||
public function frontControllerPath($sitePath, $siteName, $uri)
|
public function frontControllerPath($sitePath, $siteName, $uri)
|
||||||
{
|
{
|
||||||
if (isset($_SERVER['HTTP_X_ORIGINAL_HOST'])) {
|
|
||||||
$_SERVER['HTTP_HOST'] = $_SERVER['HTTP_X_ORIGINAL_HOST'];
|
|
||||||
}
|
|
||||||
|
|
||||||
return $sitePath.'/public/index.php';
|
return $sitePath.'/public/index.php';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
15
server.php
15
server.php
@@ -74,10 +74,20 @@ function show_valet_404()
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Dispatch the request.
|
* Overwrite the HTTP host for Ngrok.
|
||||||
|
*/
|
||||||
|
if (isset($_SERVER['HTTP_X_ORIGINAL_HOST'])) {
|
||||||
|
$_SERVER['HTTP_HOST'] = $_SERVER['HTTP_X_ORIGINAL_HOST'];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allow driver to mutate incoming URL.
|
||||||
*/
|
*/
|
||||||
$uri = $valetDriver->mutateUri($uri);
|
$uri = $valetDriver->mutateUri($uri);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine if the incoming request is for a static file.
|
||||||
|
*/
|
||||||
$uriPathInfo = pathinfo($uri);
|
$uriPathInfo = pathinfo($uri);
|
||||||
|
|
||||||
$isPhpFile = false;
|
$isPhpFile = false;
|
||||||
@@ -90,6 +100,9 @@ function show_valet_404()
|
|||||||
return $valetDriver->serveStaticFile($staticFilePath, $valetSitePath, $siteName, $uri);
|
return $valetDriver->serveStaticFile($staticFilePath, $valetSitePath, $siteName, $uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Attempt to dispatch to a front controller.
|
||||||
|
*/
|
||||||
$frontControllerPath = $valetDriver->frontControllerPath(
|
$frontControllerPath = $valetDriver->frontControllerPath(
|
||||||
$valetSitePath, $siteName, $uri
|
$valetSitePath, $siteName, $uri
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user