mirror of
https://github.com/laravel/valet.git
synced 2026-02-05 16:40:05 +01:00
Update drivers location and loading
- Extract much of server.php into a `Server` class - Move all but the Laravel and Basic drivers into a subfolder - Load all but the Laravel and Basic drivers via glob - Add `beforeLoading` hook to simplify the `frontControllerPath` method for some drivers
This commit is contained in:
@@ -10,7 +10,7 @@ class SampleValetDriver extends ValetDriver
|
||||
* @param string $uri
|
||||
* @return bool
|
||||
*/
|
||||
public function serves($sitePath, $siteName, $uri)
|
||||
public function serves(string $sitePath, string $siteName, string $uri): bool
|
||||
{
|
||||
// if (file_exists($sitePath.'/file-that-identifies-my-framework')) {
|
||||
// return true;
|
||||
@@ -27,7 +27,7 @@ public function serves($sitePath, $siteName, $uri)
|
||||
* @param string $uri
|
||||
* @return string|false
|
||||
*/
|
||||
public function isStaticFile($sitePath, $siteName, $uri)
|
||||
public function isStaticFile(string $sitePath, string $siteName, string $uri): string|false
|
||||
{
|
||||
if (file_exists($staticFilePath = $sitePath.'/public/'.$uri)) {
|
||||
return $staticFilePath;
|
||||
@@ -44,7 +44,7 @@ public function isStaticFile($sitePath, $siteName, $uri)
|
||||
* @param string $uri
|
||||
* @return string
|
||||
*/
|
||||
public function frontControllerPath($sitePath, $siteName, $uri)
|
||||
public function frontControllerPath(string $sitePath, string $siteName, string $uri): string
|
||||
{
|
||||
return $sitePath.'/public/index.php';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user