Skip to content

Commit 78d8487

Browse files
authored
Merge pull request #5780 from kenjis/fix-app-config-routes-loaded-twice
fix: app/Config/Routes.php is loaded twice on Windows
2 parents f969513 + 3e52f41 commit 78d8487

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

system/Router/RouteCollection.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,9 +357,14 @@ protected function discoverRoutes()
357357
if ($this->moduleConfig->shouldDiscover('routes')) {
358358
$files = $this->fileLocator->search('Config/Routes.php');
359359

360+
$excludes = [
361+
APPPATH . 'Config' . DIRECTORY_SEPARATOR . 'Routes.php',
362+
SYSTEMPATH . 'Config' . DIRECTORY_SEPARATOR . 'Routes.php',
363+
];
364+
360365
foreach ($files as $file) {
361366
// Don't include our main file again...
362-
if ($file === APPPATH . 'Config/Routes.php') {
367+
if (in_array($file, $excludes, true)) {
363368
continue;
364369
}
365370

0 commit comments

Comments
 (0)