1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/guanguans-coole

Присоединиться к Gitlife
Откройте для себя и примите участие в публичных проектах с открытым исходным кодом с участием более 10 миллионов разработчиков. Приватные репозитории также полностью бесплатны :)
Присоединиться бесплатно
Клонировать/Скачать
LocalValetDriver.php 1.8 КБ
Копировать Редактировать Web IDE Исходные данные Просмотреть построчно История
guanguans Отправлено 22.09.2022 13:38 c463776
<?php
declare(strict_types=1);
/**
* This file is part of Coole.
*
* @link https://github.com/guanguans/coole
* @contact guanguans <ityaozm@gmail.com>
* @license https://github.com/guanguans/coole/blob/main/LICENSE
*/
/**
* This file is part of Coole.
*
* @see https://github.com/guanguans/coole
*
* @contact guanguans <ityaozm@gmail.com>
*
* @license https://github.com/guanguans/coole/blob/main/LICENSE
*/
class LocalValetDriver extends BasicValetDriver
{
/**
* 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.'/bin/cooler') && $this->asRootPhpIndexFile($sitePath);
}
/**
* 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 = $this->asActualFile($sitePath, $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)
{
$_SERVER['DOCUMENT_ROOT'] = $sitePath;
$_SERVER['SERVER_NAME'] = $_SERVER['HTTP_HOST'];
$_SERVER['SCRIPT_NAME'] = $_SERVER['PHP_SELF'] = '/index.php';
$_SERVER['SCRIPT_FILENAME'] = $this->asRootPhpIndexFile($sitePath);
return $_SERVER['SCRIPT_FILENAME'];
}
}

Опубликовать ( 0 )

Вы можете оставить комментарий после Вход в систему

1
https://api.gitlife.ru/oschina-mirror/guanguans-coole.git
git@api.gitlife.ru:oschina-mirror/guanguans-coole.git
oschina-mirror
guanguans-coole
guanguans-coole
main