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

improve static driver

This commit is contained in:
Taylor Otwell
2016-05-05 14:20:02 -05:00
parent 065072a72b
commit c29429ba60
4 changed files with 15 additions and 7 deletions

View File

@@ -25,7 +25,15 @@ public function serves($sitePath, $siteName, $uri)
*/
public function isStaticFile($sitePath, $siteName, $uri)
{
return $sitePath.$uri;
if (file_exists($staticFilePath = $sitePath.$uri) && ! is_dir($staticFilePath)) {
return $staticFilePath;
} elseif (file_exists($staticFilePath = $sitePath.$uri.'/index.html')) {
return $staticFilePath;
} elseif (file_exists($staticFilePath = $sitePath.$uri)) {
return $staticFilePath;
}
return false;
}
/**