Skip to content

Commit 40c6b28

Browse files
authored
Update KirbyValetDriver.php
This makes it possible to open PHP files again, see this discussion. The solution from rasteiner works perfectly. You can also have a look @pedroborges ? https://forum.getkirby.com/t/use-php-and-kirby-in-css-file/30724
1 parent d91e62d commit 40c6b28

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

cli/Valet/Drivers/Specific/KirbyValetDriver.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,17 @@ public function frontControllerPath(string $sitePath, string $siteName, string $
4848
$indexPath = $sitePath.'/panel/index.php';
4949
}
5050

51+
// add this block
52+
if (preg_match('/^\/(?!(kirby|site|content)\/).+\.php$/', $uri)) {
53+
if (
54+
$this->isActualFile($sitePath.$uri) ||
55+
$isAboveWebroot && $this->isActualFile($sitePath."/public".$uri)
56+
) {
57+
$scriptName = $uri;
58+
$indexPath = $sitePath.$scriptName;
59+
}
60+
}
61+
5162
$sitePathPrefix = ($isAboveWebroot) ? $sitePath.'/public' : $sitePath;
5263

5364
$_SERVER['SERVER_NAME'] = $_SERVER['HTTP_HOST'];

0 commit comments

Comments
 (0)