From 3e52f412d024f0d50f0041d676e7c56197f5a5c0 Mon Sep 17 00:00:00 2001 From: kenjis Date: Mon, 7 Mar 2022 08:43:59 +0900 Subject: [PATCH] fix: app/Config/Routes.php is loaded twice on Windows system/Config/Routes.php is loaded in app/Config/Routes.php --- system/Router/RouteCollection.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/system/Router/RouteCollection.php b/system/Router/RouteCollection.php index 7eded3411b7f..65bf4f4985af 100644 --- a/system/Router/RouteCollection.php +++ b/system/Router/RouteCollection.php @@ -357,9 +357,14 @@ protected function discoverRoutes() if ($this->moduleConfig->shouldDiscover('routes')) { $files = $this->fileLocator->search('Config/Routes.php'); + $excludes = [ + APPPATH . 'Config' . DIRECTORY_SEPARATOR . 'Routes.php', + SYSTEMPATH . 'Config' . DIRECTORY_SEPARATOR . 'Routes.php', + ]; + foreach ($files as $file) { // Don't include our main file again... - if ($file === APPPATH . 'Config/Routes.php') { + if (in_array($file, $excludes, true)) { continue; }