mirror of
https://github.com/laravel/valet.git
synced 2026-02-06 16:50:09 +01:00
Add Katana Driver
This commit is contained in:
28
drivers/KatanaValetDriver.php
Normal file
28
drivers/KatanaValetDriver.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
class KatanaValetDriver extends StaticValetDriver
|
||||
{
|
||||
/**
|
||||
* Mutate the incoming URI.
|
||||
*
|
||||
* @param string $uri
|
||||
* @return string
|
||||
*/
|
||||
public function mutateUri($uri)
|
||||
{
|
||||
return rtrim('/public'.$uri, '/');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the driver serves the request.
|
||||
*
|
||||
* @param string $sitePath
|
||||
* @param string $siteName
|
||||
* @param string $uri
|
||||
* @return void
|
||||
*/
|
||||
public function serves($sitePath, $siteName, $uri)
|
||||
{
|
||||
return file_exists($sitePath.'/katana');
|
||||
}
|
||||
}
|
||||
@@ -50,6 +50,7 @@ public static function assign($sitePath, $siteName, $uri)
|
||||
$drivers[] = 'WordPressValetDriver';
|
||||
$drivers[] = 'CraftValetDriver';
|
||||
$drivers[] = 'StaticValetDriver';
|
||||
$drivers[] = 'KatanaValetDriver';
|
||||
|
||||
foreach ($drivers as $driver) {
|
||||
$driver = new $driver;
|
||||
|
||||
@@ -7,3 +7,4 @@
|
||||
require_once __DIR__.'/JigsawValetDriver.php';
|
||||
require_once __DIR__.'/WordPressValetDriver.php';
|
||||
require_once __DIR__.'/CraftValetDriver.php';
|
||||
require_once __DIR__.'/KatanaValetDriver.php';
|
||||
|
||||
Reference in New Issue
Block a user