File tree Expand file tree Collapse file tree 1 file changed +44
-0
lines changed
cli/Valet/Drivers/Specific Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Valet \Drivers \Specific ;
4
+
5
+ use Valet \Drivers \ValetDriver ;
6
+
7
+ class NetteValetDriver extends ValetDriver
8
+ {
9
+ /**
10
+ * Determine if the driver serves the request.
11
+ */
12
+ public function serves (string $ sitePath , string $ siteName , string $ uri ): bool
13
+ {
14
+ return file_exists ($ sitePath .'/www/index.php ' )
15
+ && file_exists ($ sitePath .'/www/.htaccess ' )
16
+ && file_exists ($ sitePath .'/config/common.neon ' )
17
+ && file_exists ($ sitePath .'/config/services.neon ' );
18
+ }
19
+
20
+ /**
21
+ * Determine if the incoming request is for a static file.
22
+ */
23
+ public function isStaticFile (string $ sitePath , string $ siteName , string $ uri )/*: string|false */
24
+ {
25
+ if ($ this ->isActualFile ($ staticFilePath = $ sitePath .'/www/ ' .$ uri )) {
26
+ return $ staticFilePath ;
27
+ }
28
+
29
+ return false ;
30
+ }
31
+
32
+ /**
33
+ * Get the fully resolved path to the application's front controller.
34
+ */
35
+ public function frontControllerPath (string $ sitePath , string $ siteName , string $ uri ): ?string
36
+ {
37
+ $ _SERVER ['DOCUMENT_ROOT ' ] = $ sitePath .'/www ' ;
38
+ $ _SERVER ['SCRIPT_FILENAME ' ] = $ sitePath .'/www/index.php ' ;
39
+ $ _SERVER ['SCRIPT_NAME ' ] = '/index.php ' ;
40
+ $ _SERVER ['PHP_SELF ' ] = '/index.php ' ;
41
+
42
+ return $ sitePath .'/www/index.php ' ;
43
+ }
44
+ }
You can’t perform that action at this time.
0 commit comments