1
0
mirror of https://github.com/laravel/valet.git synced 2026-02-04 08:10:07 +01:00

Write tests for Server.php

This commit is contained in:
Matt Stauffer
2022-12-21 17:45:34 -05:00
parent f344592dd0
commit 65b629db7f
6 changed files with 163 additions and 65 deletions

View File

@@ -24,12 +24,12 @@
/**
* Parse the URI and site / host for the incoming request.
*/
$uri = $server->uriFromRequestUri($_SERVER['REQUEST_URI']);
$uri = Server::uriFromRequestUri($_SERVER['REQUEST_URI']);
$siteName = $server->siteNameFromHttpHost($_SERVER['HTTP_HOST']);
$valetSitePath = $server->sitePath($siteName);
if (is_null($valetSitePath) && is_null($valetSitePath = $server->defaultSitePath())) {
$server->show404();
Server::show404();
}
$valetSitePath = realpath($valetSitePath);
@@ -40,7 +40,7 @@
$valetDriver = ValetDriver::assign($valetSitePath, $siteName, $uri);
if (! $valetDriver) {
$server->show404();
Server::show404();
}
/**
@@ -85,10 +85,10 @@
if (! $frontControllerPath) {
if (isset($valetConfig['directory-listing']) && $valetConfig['directory-listing'] == 'on') {
$server->showDirectoryListing($valetSitePath, $uri);
Server::showDirectoryListing($valetSitePath, $uri);
}
$server->show404();
Server::show404();
}
chdir(dirname($frontControllerPath));