-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSampleValetDriver.php
40 lines (33 loc) · 1003 Bytes
/
SampleValetDriver.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
namespace Valet\Drivers\Custom;
use Valet\Drivers\ValetDriver;
class SampleValetDriver extends ValetDriver
{
/**
* Determine if the driver serves the request.
*/
public function serves(string $sitePath, string $siteName, string $uri): bool
{
// if (file_exists($sitePath.'/file-that-identifies-my-framework')) {
// return true;
// }
return false;
}
/**
* Determine if the incoming request is for a static file.
*/
public function isStaticFile(string $sitePath, string $siteName, string $uri)/*: string|false */
{
if (file_exists($staticFilePath = $sitePath.'/public/'.$uri)) {
return $staticFilePath;
}
return false;
}
/**
* Get the fully resolved path to the application's front controller.
*/
public function frontControllerPath(string $sitePath, string $siteName, string $uri): string
{
return $sitePath.'/public/index.php';
}
}