Skip to content

Commit 3e52f41

Browse files
committed
fix: app/Config/Routes.php is loaded twice on Windows
system/Config/Routes.php is loaded in app/Config/Routes.php
1 parent f969513 commit 3e52f41

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)