mirror of
https://github.com/codeigniter4/CodeIgniter4.git
synced 2025-02-20 11:44:28 +08:00
fix: replace cli with CLI
This commit is contained in:
parent
9b07cb5dd6
commit
4df364bd5d
@ -453,7 +453,7 @@ class CodeIgniter
|
||||
*/
|
||||
protected function handleRequest(?RouteCollectionInterface $routes, Cache $cacheConfig, bool $returnResponse = false)
|
||||
{
|
||||
if ($this->request instanceof IncomingRequest && strtolower($this->request->getMethod()) === 'cli') {
|
||||
if ($this->request instanceof IncomingRequest && $this->request->getMethod() === 'CLI') {
|
||||
return $this->response->setStatusCode(405)->setBody('Method Not Allowed');
|
||||
}
|
||||
|
||||
|
@ -120,7 +120,7 @@ final class AutoRouter implements AutoRouterInterface
|
||||
}
|
||||
|
||||
// Ensure routes registered via $routes->cli() are not accessible via web.
|
||||
if ($this->httpVerb !== 'cli') {
|
||||
if ($this->httpVerb !== 'CLI') {
|
||||
$controller = '\\' . $this->defaultNamespace;
|
||||
|
||||
$controller .= $this->directory ? str_replace('/', '\\', $this->directory) : '';
|
||||
|
@ -137,7 +137,7 @@ class Router implements RouterInterface
|
||||
);
|
||||
} else {
|
||||
$this->autoRouter = new AutoRouter(
|
||||
$this->collection->getRoutes('cli', false), // @phpstan-ignore-line
|
||||
$this->collection->getRoutes('CLI', false), // @phpstan-ignore-line
|
||||
$this->collection->getDefaultNamespace(),
|
||||
$this->collection->getDefaultController(),
|
||||
$this->collection->getDefaultMethod(),
|
||||
|
Loading…
x
Reference in New Issue
Block a user