Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion system/CodeIgniter.php
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ protected function handleRequest(?RouteCollectionInterface $routes, Cache $cache
{
$routeFilter = $this->tryToRouteIt($routes);

// Run "before" filters
// Start up the filters
$filters = Services::filters();

// If any filters were specified within the routes file,
Expand All @@ -388,7 +388,10 @@ protected function handleRequest(?RouteCollectionInterface $routes, Cache $cache

// Never run filters when running through Spark cli
if (! defined('SPARKED')) {
// Run "before" filters
$this->benchmark->start('before_filters');
$possibleResponse = $filters->run($uri, 'before');
$this->benchmark->stop('before_filters');

// If a ResponseInterface instance is returned then send it back to the client and stop
if ($possibleResponse instanceof ResponseInterface) {
Expand Down Expand Up @@ -427,8 +430,11 @@ protected function handleRequest(?RouteCollectionInterface $routes, Cache $cache
// Never run filters when running through Spark cli
if (! defined('SPARKED')) {
$filters->setResponse($this->response);

// Run "after" filters
$this->benchmark->start('after_filters');
$response = $filters->run($uri, 'after');
$this->benchmark->stop('after_filters');
} else {
$response = $this->response;

Expand Down