Do not rely on GLOB_BRACE as it is not available on musl based systems

This commit is contained in:
Koen De Causmaecker
2017-09-21 07:51:40 +02:00
parent b5f6c239b4
commit 887ed179e8

View File

@@ -89,12 +89,7 @@ class RouteServiceProvider extends ServiceProvider
$router->group(['namespace' => $this->namespace, 'as' => 'core::'], function (Router $router) {
$path = app_path('Http/Routes');
// GLOB_BRACE is defined as 0, check the source!
// https://github.com/php/php-src/blob/31e4afe3c3654f9c5ab2eafa3a02c62d41c58b47/ext/standard/dir.c#L154-L158
$globBrace = defined('GLOB_BRACE') ? GLOB_BRACE : 0;
$globFlag = $globBrace;
foreach (glob("{$path}/*{,/*}.php", $globFlag) as $file) {
foreach (array_merge(glob("$path/*.php"), glob("$path/*/*.php")) as $file) {
$class = substr($file, strlen($path));
$class = str_replace('/', '\\', $class);
$class = substr($class, 0, -4);