Skip to content

Commit

Permalink
Always use / in classmap and files autoloader paths #30
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianHenryIE committed Sep 1, 2021
1 parent 26cb474 commit 2636ca1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ function (&$filepath, $_class) use ($dir, $dirname) {
echo "\${$dirname} = dirname(__FILE__);\n\n";
echo "return array(\n";
foreach ($dirMap as $class => $file) {
// Always use `/` in paths.
$file = str_replace(DIRECTORY_SEPARATOR, '/', $file);
echo " '{$class}' => {$file},\n";
}
echo ");";
Expand Down Expand Up @@ -150,6 +152,8 @@ protected function generateFilesAutoloader()
if (!isset($filePathinfo['extension']) || 'php' !== $filePathinfo['extension']) {
continue;
}
// Always use `/` in paths.
$filepath = str_replace(DIRECTORY_SEPARATOR, '/', $filepath);
echo "require_once __DIR__ . '{$filepath}';\n";
}
}
Expand Down

0 comments on commit 2636ca1

Please sign in to comment.