1
0
mirror of https://github.com/laravel/valet.git synced 2026-02-06 08:40:09 +01:00

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
This commit is contained in:
Oli
2024-02-19 09:49:37 +01:00
committed by GitHub
parent d91e62dd20
commit 40c6b2891b

View File

@@ -48,6 +48,17 @@ public function frontControllerPath(string $sitePath, string $siteName, string $
$indexPath = $sitePath.'/panel/index.php';
}
// add this block
if (preg_match('/^\/(?!(kirby|site|content)\/).+\.php$/', $uri)) {
if (
$this->isActualFile($sitePath.$uri) ||
$isAboveWebroot && $this->isActualFile($sitePath."/public".$uri)
) {
$scriptName = $uri;
$indexPath = $sitePath.$scriptName;
}
}
$sitePathPrefix = ($isAboveWebroot) ? $sitePath.'/public' : $sitePath;
$_SERVER['SERVER_NAME'] = $_SERVER['HTTP_HOST'];