Skip to content

Commit ffbd943

Browse files
author
Wazabii
committed
Minor route bug
1 parent 42dd900 commit ffbd943

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Kernel/App.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,12 @@ protected function setupRouters(): void
115115
foreach ($routerFiles as $file) {
116116
if (!in_array($file, $this->exclRouterFiles)) {
117117
$dir = $this->dir->getRoot();
118-
if(strpos($file, "/") === 0) {
119-
$path = "{$dir}".ltrim($file, "/");
118+
if(strpos($file, "./") === 0) {
119+
$path = realpath(dirname(__FILE__).substr($file, 1).".php");
120120
} else {
121-
$path = "{$dir}app/Http/Routes/{$file}";
121+
$path = "{$dir}app/Http/Routes/{$file}.php";
122122
}
123-
$this->includeRoutes($this->dispatcher, "{$path}.php");
123+
$this->includeRoutes($this->dispatcher, $path);
124124
}
125125
}
126126
}
@@ -129,7 +129,7 @@ protected function setupRouters(): void
129129

130130
protected function defualtRoutes(array $routerFiles) {
131131
if($this->dispatcher->getMethod() === "CLI") {
132-
$routerFiles[] = "/app/Libraries/Foundation/Cli/Routers/default";
132+
$routerFiles[] = "./../Cli/Routers/default";
133133
}
134134
return $routerFiles;
135135
}

0 commit comments

Comments
 (0)