mirror of
https://github.com/codeigniter4/CodeIgniter4.git
synced 2025-02-20 11:44:28 +08:00
Enable general benchmarking for filters.
Fix copy paste.
This commit is contained in:
parent
57c53427c4
commit
d263210eef
@ -357,7 +357,7 @@ class CodeIgniter
|
||||
{
|
||||
$routeFilter = $this->tryToRouteIt($routes);
|
||||
|
||||
// Run "before" filters
|
||||
// Start up the filters
|
||||
$filters = Services::filters();
|
||||
|
||||
// If any filters were specified within the routes file,
|
||||
@ -371,7 +371,10 @@ class CodeIgniter
|
||||
|
||||
// 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) {
|
||||
@ -410,8 +413,11 @@ class CodeIgniter
|
||||
// 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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user