Skip to content

Commit 15586a0

Browse files
committed
perf: skip tokenizing the default Config/Filters.php files during discovery
1 parent 99f9f92 commit 15586a0

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

‎system/Filters/Filters.php‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,18 @@ private function discoverFilters(): void
154154

155155
$files = $locator->search('Config/Filters.php');
156156

157+
// Our main Filter configs are never included again, see below. Skip them
158+
// by path, as reading and tokenizing them to find that out is wasted work.
159+
$mainFiles = [
160+
APPPATH . 'Config' . DIRECTORY_SEPARATOR . 'Filters.php',
161+
SYSTEMPATH . 'Config' . DIRECTORY_SEPARATOR . 'Filters.php',
162+
];
163+
157164
foreach ($files as $file) {
165+
if (in_array($file, $mainFiles, true)) {
166+
continue;
167+
}
168+
158169
// The $file may not be a class file.
159170
$className = $locator->getClassname($file);
160171

0 commit comments

Comments
 (0)