-
Notifications
You must be signed in to change notification settings - Fork 0
/
NetteValetDriver.php
44 lines (35 loc) · 1.03 KB
/
NetteValetDriver.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
41
42
<?php
namespace Valet\Drivers\Custom;
use Valet\Drivers\ValetDriver;
class NetteValetDriver extends ValetDriver
{
/**
* Determine if the driver serves the request.
*/
public function serves(string $sitePath, string $siteName, string $uri): bool
{
if (file_exists($sitePath . '/app/Bootstrap.php') &&
file_exists($sitePath . '/config/common.neon')
) {
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 . '/www/' . $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 . '/www/index.php';
}
}