Don't run filters when using spark. Closes #1519

This commit is contained in:
Lonnie Ezell 2018-11-22 22:49:08 -06:00
parent 90f6f37111
commit 2047b5a1f5
No known key found for this signature in database
GPG Key ID: 71836D6EF250F1D1
2 changed files with 25 additions and 11 deletions

2
spark
View File

@ -12,6 +12,8 @@
* this class mainly acts as a passthru to the framework itself.
*/
define('SPARKED', true);
/*
*---------------------------------------------------------------
* BOOTSTRAP THE APPLICATION

View File

@ -297,6 +297,9 @@ class CodeIgniter
$uri = $this->request instanceof CLIRequest ? $this->request->getPath() : $this->request->uri->getPath();
// Never run filters when running through Spark cli
if (! defined('SPARKED'))
{
$possibleRedirect = $filters->run($uri, 'before');
if ($possibleRedirect instanceof RedirectResponse)
{
@ -307,6 +310,7 @@ class CodeIgniter
{
return $possibleRedirect->send();
}
}
$returned = $this->startController();
@ -331,9 +335,17 @@ class CodeIgniter
// so it can be used with the output.
$this->gatherOutput($cacheConfig, $returned);
// Never run filters when running through Spark cli
if (! defined('SPARKED'))
{
$filters->setResponse($this->response);
// Run "after" filters
$response = $filters->run($uri, 'after');
}
else
{
$response = $this->response;
}
if ($response instanceof Response)
{