mirror of
https://github.com/laravel/valet.git
synced 2026-02-07 01:00:09 +01:00
add NeosValetDriver
This commit is contained in:
50
cli/drivers/NeosValetDriver.php
Normal file
50
cli/drivers/NeosValetDriver.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
class NeosValetDriver extends ValetDriver
|
||||
{
|
||||
/**
|
||||
* Determine if the driver serves the request.
|
||||
*
|
||||
* @param string $sitePath
|
||||
* @param string $siteName
|
||||
* @param string $uri
|
||||
* @return bool
|
||||
*/
|
||||
public function serves($sitePath, $siteName, $uri)
|
||||
{
|
||||
return file_exists($sitePath.'/flow') && is_dir($sitePath.'/Web');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the incoming request is for a static file.
|
||||
*
|
||||
* @param string $sitePath
|
||||
* @param string $siteName
|
||||
* @param string $uri
|
||||
* @return string|false
|
||||
*/
|
||||
public function isStaticFile($sitePath, $siteName, $uri)
|
||||
{
|
||||
if ($this->isActualFile($staticFilePath = $sitePath.'/Web'.$uri)) {
|
||||
return $staticFilePath;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the fully resolved path to the application's front controller.
|
||||
*
|
||||
* @param string $sitePath
|
||||
* @param string $siteName
|
||||
* @param string $uri
|
||||
* @return string
|
||||
*/
|
||||
public function frontControllerPath($sitePath, $siteName, $uri)
|
||||
{
|
||||
putenv('FLOW_CONTEXT=Development');
|
||||
putenv('FLOW_REWRITEURLS=1');
|
||||
$_SERVER['SCRIPT_FILENAME'] = $sitePath.'/Web/index.php';
|
||||
$_SERVER['SCRIPT_NAME'] = '/index.php';
|
||||
return $sitePath.'/Web/index.php';
|
||||
}
|
||||
}
|
||||
@@ -68,6 +68,7 @@ public static function assign($sitePath, $siteName, $uri)
|
||||
$drivers[] = 'DrupalValetDriver';
|
||||
$drivers[] = 'Concrete5ValetDriver';
|
||||
$drivers[] = 'Typo3ValetDriver';
|
||||
$drivers[] = 'NeosValetDriver';
|
||||
|
||||
$drivers[] = 'BasicValetDriver';
|
||||
|
||||
|
||||
@@ -26,3 +26,4 @@
|
||||
require_once __DIR__.'/DrupalValetDriver.php';
|
||||
require_once __DIR__.'/Concrete5ValetDriver.php';
|
||||
require_once __DIR__.'/Typo3ValetDriver.php';
|
||||
require_once __DIR__.'/NeosValetDriver.php';
|
||||
|
||||
Reference in New Issue
Block a user