mirror of
https://github.com/codeigniter4/CodeIgniter4.git
synced 2025-02-20 11:44:28 +08:00
Don't run filters when using spark. Closes #1519
This commit is contained in:
parent
90f6f37111
commit
2047b5a1f5
2
spark
2
spark
@ -12,6 +12,8 @@
|
|||||||
* this class mainly acts as a passthru to the framework itself.
|
* this class mainly acts as a passthru to the framework itself.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
define('SPARKED', true);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*---------------------------------------------------------------
|
*---------------------------------------------------------------
|
||||||
* BOOTSTRAP THE APPLICATION
|
* BOOTSTRAP THE APPLICATION
|
||||||
|
@ -297,15 +297,19 @@ class CodeIgniter
|
|||||||
|
|
||||||
$uri = $this->request instanceof CLIRequest ? $this->request->getPath() : $this->request->uri->getPath();
|
$uri = $this->request instanceof CLIRequest ? $this->request->getPath() : $this->request->uri->getPath();
|
||||||
|
|
||||||
$possibleRedirect = $filters->run($uri, 'before');
|
// Never run filters when running through Spark cli
|
||||||
if ($possibleRedirect instanceof RedirectResponse)
|
if (! defined('SPARKED'))
|
||||||
{
|
{
|
||||||
return $possibleRedirect;
|
$possibleRedirect = $filters->run($uri, 'before');
|
||||||
}
|
if ($possibleRedirect instanceof RedirectResponse)
|
||||||
// If a Response instance is returned, the Response will be sent back to the client and script execution will stop
|
{
|
||||||
if ($possibleRedirect instanceof ResponseInterface)
|
return $possibleRedirect;
|
||||||
{
|
}
|
||||||
return $possibleRedirect->send();
|
// If a Response instance is returned, the Response will be sent back to the client and script execution will stop
|
||||||
|
if ($possibleRedirect instanceof ResponseInterface)
|
||||||
|
{
|
||||||
|
return $possibleRedirect->send();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$returned = $this->startController();
|
$returned = $this->startController();
|
||||||
@ -331,9 +335,17 @@ class CodeIgniter
|
|||||||
// so it can be used with the output.
|
// so it can be used with the output.
|
||||||
$this->gatherOutput($cacheConfig, $returned);
|
$this->gatherOutput($cacheConfig, $returned);
|
||||||
|
|
||||||
$filters->setResponse($this->response);
|
// Never run filters when running through Spark cli
|
||||||
// Run "after" filters
|
if (! defined('SPARKED'))
|
||||||
$response = $filters->run($uri, 'after');
|
{
|
||||||
|
$filters->setResponse($this->response);
|
||||||
|
// Run "after" filters
|
||||||
|
$response = $filters->run($uri, 'after');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$response = $this->response;
|
||||||
|
}
|
||||||
|
|
||||||
if ($response instanceof Response)
|
if ($response instanceof Response)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user