File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
cli/Valet/Drivers/Specific Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change 7
7
class Magento2ValetDriver extends ValetDriver
8
8
{
9
9
/**
10
- * @inheritdoc
10
+ * { @inheritdoc}
11
11
*/
12
12
public function serves (string $ sitePath , string $ siteName , string $ uri ): bool
13
13
{
14
14
return file_exists ($ sitePath .'/bin/magento ' ) && file_exists ($ sitePath .'/pub/index.php ' );
15
15
}
16
16
17
17
/**
18
- * @inheritdoc
18
+ * { @inheritdoc}
19
19
*/
20
20
public function isStaticFile (string $ sitePath , string $ siteName , string $ uri )/*: string|false */
21
21
{
22
22
$ uri = preg_replace ('/^\/static(\/version[\d]+)/ ' , '/static ' , $ uri );
23
23
24
- if (file_exists ($ staticFilePath = $ sitePath . '/pub ' . $ uri )) {
24
+ if (file_exists ($ staticFilePath = $ sitePath. '/pub ' . $ uri )) {
25
25
return $ staticFilePath ;
26
26
}
27
27
28
28
if (strpos ($ uri , '/static/ ' ) === 0 ) {
29
29
$ _GET ['resource ' ] = preg_replace ('#static/# ' , '' , $ uri , 1 );
30
- include ( $ sitePath . '/pub/static.php ' ) ;
30
+ include $ sitePath. '/pub/static.php ' ;
31
31
exit ;
32
32
}
33
33
34
34
if (strpos ($ uri , '/media/ ' ) === 0 ) {
35
- include ( $ sitePath . '/pub/get.php ' ) ;
35
+ include $ sitePath. '/pub/get.php ' ;
36
36
exit ;
37
37
}
38
38
39
39
return false ;
40
40
}
41
41
42
42
/**
43
- * @inheritdoc
43
+ * { @inheritdoc}
44
44
*/
45
45
public function frontControllerPath (string $ sitePath , string $ siteName , string $ uri ): ?string
46
46
{
47
- $ _SERVER ['SERVER_NAME ' ] = $ _SERVER ['HTTP_HOST ' ];
47
+ $ _SERVER ['SERVER_NAME ' ] = $ _SERVER ['HTTP_HOST ' ];
48
48
$ _SERVER ['DOCUMENT_ROOT ' ] = $ sitePath ;
49
49
50
50
return $ sitePath .'/pub/index.php ' ;
You can’t perform that action at this time.
0 commit comments