Skip to content

Commit

Permalink
Merge pull request #5780 from kenjis/fix-app-config-routes-loaded-twice
Browse files Browse the repository at this point in the history
fix: app/Config/Routes.php is loaded twice on Windows
  • Loading branch information
samsonasik authored Mar 7, 2022
2 parents f969513 + 3e52f41 commit 78d8487
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion system/Router/RouteCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 78d8487

Please sign in to comment.