Check if GLOB_BRACE is defined before using it. Fixes #2586

This commit is contained in:
James Brooks
2017-06-24 18:38:36 +01:00
parent 261be1dfef
commit 1319788107

View File

@@ -89,7 +89,10 @@ class RouteServiceProvider extends ServiceProvider
$router->group(['namespace' => $this->namespace, 'as' => 'core::'], function (Router $router) {
$path = app_path('Http/Routes');
foreach (glob("{$path}/*{,/*}.php", GLOB_BRACE) as $file) {
$globBrace = defined('GLOB_BRACE') ? GLOB_BRACE : 0;
$globFlag = $globBrace;
foreach (glob("{$path}/*{,/*}.php", $globFlag) as $file) {
$class = substr($file, strlen($path));
$class = str_replace('/', '\\', $class);
$class = substr($class, 0, -4);