1
0
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:
Mohamed Said
2016-05-06 10:57:30 +02:00
parent 49cdcea51c
commit f806a79031
3 changed files with 30 additions and 0 deletions

View 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');
}
}

View File

@@ -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;

View File

@@ -7,3 +7,4 @@
require_once __DIR__.'/JigsawValetDriver.php';
require_once __DIR__.'/WordPressValetDriver.php';
require_once __DIR__.'/CraftValetDriver.php';
require_once __DIR__.'/KatanaValetDriver.php';