Skip to content

Commit b1d3dd9

Browse files
committed
refactor: move discoverFilters() to the instructor
1 parent 0f036a6 commit b1d3dd9

2 files changed

Lines changed: 4 additions & 7 deletions

File tree

system/CodeIgniter.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -363,9 +363,6 @@ protected function handleRequest(?RouteCollectionInterface $routes, Cache $cache
363363
// Start up the filters
364364
$filters = Services::filters();
365365

366-
// Discover filters
367-
$filters->initialize(strtolower($uri));
368-
369366
// If any filters were specified within the routes file,
370367
// we need to ensure it's active for the current request
371368
if ($routeFilter !== null) {

system/Filters/Filters.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@ public function __construct($config, RequestInterface $request, ResponseInterfac
107107
$this->setResponse($response);
108108

109109
$this->modules = $modules ?? config('Modules');
110+
111+
if ($this->modules->shouldDiscover('filters')) {
112+
$this->discoverFilters();
113+
}
110114
}
111115

112116
/**
@@ -225,10 +229,6 @@ public function initialize(?string $uri = null)
225229
return $this;
226230
}
227231

228-
if ($this->modules->shouldDiscover('filters')) {
229-
$this->discoverFilters();
230-
}
231-
232232
$this->processGlobals($uri);
233233
$this->processMethods();
234234
$this->processFilters($uri);

0 commit comments

Comments
 (0)