Replace GLOB_BRACE as its not supported by all systems.

This commit is contained in:
FusionPBX 2023-08-14 11:27:40 -06:00 committed by GitHub
parent 93058bfc57
commit 4bf775897e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 1 deletions

View File

@ -2933,7 +2933,18 @@
$schema = self::sanitize($schema);
//get the apps array
$config_list = glob($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH . "/{core,app}/{".$schema.",".self::singular($schema)."}/app_config.php", GLOB_BRACE);
$config_list = [];
$directories = ["core", "app"];
$applications = [$schema, self::singular($schema)];
foreach ($directories as $directory) {
foreach ($applications as $application) {
$path = $_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH . "/$directory/$application/app_config.php";
$app_config_files = glob($path);
if ($app_config_files !== false) {
$config_list = array_merge($config_list, $app_config_files);
}
}
}
$x = 0;
foreach ($config_list as &$config_path) {
include($config_path);