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:
@@ -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'];
|
||||
|
||||
Reference in New Issue
Block a user