mirror of
https://github.com/laravel/valet.git
synced 2026-02-05 16:40:05 +01:00
* Drop unnecessary doc blocks * Apply fixes from StyleCI Co-authored-by: StyleCI Bot <bot@styleci.io>
41 lines
1003 B
PHP
41 lines
1003 B
PHP
<?php
|
|
|
|
namespace Valet\Drivers\Custom;
|
|
|
|
use Valet\Drivers\ValetDriver;
|
|
|
|
class SampleValetDriver extends ValetDriver
|
|
{
|
|
/**
|
|
* Determine if the driver serves the request.
|
|
*/
|
|
public function serves(string $sitePath, string $siteName, string $uri): bool
|
|
{
|
|
// if (file_exists($sitePath.'/file-that-identifies-my-framework')) {
|
|
// return true;
|
|
// }
|
|
|
|
return false;
|
|
}
|
|
|
|
/**
|
|
* Determine if the incoming request is for a static file.
|
|
*/
|
|
public function isStaticFile(string $sitePath, string $siteName, string $uri)/*: string|false */
|
|
{
|
|
if (file_exists($staticFilePath = $sitePath.'/public/'.$uri)) {
|
|
return $staticFilePath;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
/**
|
|
* Get the fully resolved path to the application's front controller.
|
|
*/
|
|
public function frontControllerPath(string $sitePath, string $siteName, string $uri): string
|
|
{
|
|
return $sitePath.'/public/index.php';
|
|
}
|
|
}
|