diff --git a/app/music_on_hold/resources/classes/switch_music_on_hold.php b/app/music_on_hold/resources/classes/switch_music_on_hold.php index fd0a1012e6..3e3aaf1e01 100644 --- a/app/music_on_hold/resources/classes/switch_music_on_hold.php +++ b/app/music_on_hold/resources/classes/switch_music_on_hold.php @@ -138,18 +138,13 @@ include "root.php"; public function xml() { //build the list of categories $music_on_hold_dir = $_SESSION['switch']['sounds']['dir'].'/music'; - //default category - if (defined("GLOB_BRACE")) { - $array = glob($music_on_hold_dir."/{8000,16000,32000,48000}", GLOB_ONLYDIR|GLOB_BRACE); - } - else { - $array_1 = glob($music_on_hold_dir."/8000".$class_name.".php", GLOB_ONLYDIR); - $array_2 = glob($music_on_hold_dir."/16000".$class_name.".php", GLOB_ONLYDIR); - $array_3 = glob($music_on_hold_dir."/32000".$class_name.".php", GLOB_ONLYDIR); - $array_4 = glob($music_on_hold_dir."/48000".$class_name.".php", GLOB_ONLYDIR); - $array = array_merge((array)$array_1,(array)$array_2,(array)$array_3,(array)$array_4); - unset($array_1,$array_2,$array_3,$array_4); - } + //default category (note: GLOB_BRACE doesn't work on some systems) + $array_1 = glob($music_on_hold_dir."/8000".$class_name.".php", GLOB_ONLYDIR); + $array_2 = glob($music_on_hold_dir."/16000".$class_name.".php", GLOB_ONLYDIR); + $array_3 = glob($music_on_hold_dir."/32000".$class_name.".php", GLOB_ONLYDIR); + $array_4 = glob($music_on_hold_dir."/48000".$class_name.".php", GLOB_ONLYDIR); + $array = array_merge((array)$array_1,(array)$array_2,(array)$array_3,(array)$array_4); + unset($array_1,$array_2,$array_3,$array_4); //other categories if (count($_SESSION['domains']) > 1) { $array = array_merge($array, glob($music_on_hold_dir."/*/*/*", GLOB_ONLYDIR)); diff --git a/resources/classes/domains.php b/resources/classes/domains.php index 562a295b5d..fb413b8550 100644 --- a/resources/classes/domains.php +++ b/resources/classes/domains.php @@ -46,11 +46,11 @@ $prep_statement->execute(); } $result = $prep_statement->fetchAll(PDO::FETCH_NAMED); - //unset the previous settings + //unset all settings foreach ($result as $row) { unset($_SESSION[$row['default_setting_category']]); } - //set the settings as a session + //set the enabled settings as a session foreach ($result as $row) { if ($row['default_setting_enabled'] == 'true') { $name = $row['default_setting_name']; @@ -99,7 +99,7 @@ unset($_SESSION[$category][$subcategory]); } } - //set the settings as a session + //set the enabled settings as a session foreach ($result as $row) { $name = $row['domain_setting_name']; $category = $row['domain_setting_category']; @@ -220,8 +220,11 @@ //get the PROJECT PATH include "root.php"; - //get the list of installed apps from the core and app directories - $config_list = glob($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH . "/*/*/app_{config,menu}.php",GLOB_BRACE); + //get the list of installed apps from the core and app directories (note: GLOB_BRACE doesn't work on some systems) + $config_list1 = glob($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/*/*/app_config.php"); + $config_list2 = glob($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/*/*/app_menu.php"); + $config_list = array_merge((array)$config_list1, (array)$config_list2); + unset($config_list1,$config_list2); $x=0; foreach ($config_list as &$config_path) { include($config_path); diff --git a/resources/classes/menu.php b/resources/classes/menu.php index 8c256e9293..ea0b8ec99c 100644 --- a/resources/classes/menu.php +++ b/resources/classes/menu.php @@ -64,7 +64,7 @@ $db = $this->db; //get the $apps array from the installed apps from the core and mod directories - $config_list = glob($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH . "/*/*/app_{menu}.php",GLOB_BRACE); + $config_list = glob($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/*/*/app_menu.php"); $x = 0; foreach ($config_list as &$config_path) { $y = 0; diff --git a/resources/require.php b/resources/require.php index e4c7f5bb39..364e11762d 100644 --- a/resources/require.php +++ b/resources/require.php @@ -48,16 +48,11 @@ spl_autoload_register(array($this, 'loader')); } private function loader($class_name) { - //use glob to check "/resources/classes", "/{core,app}/*/resources/classes"; - if (defined("GLOB_BRACE")) { - $results = glob($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH . "{/*/*,}/resources/classes/".$class_name.".php", GLOB_BRACE); - } - else { - $array_1 = glob($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH . "/*/*/resources/classes/".$class_name.".php"); - $array_2 = glob($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH . "/resources/classes/".$class_name.".php"); - $results = array_merge((array)$array_1,(array)$array_2); - unset($array_1, $array_2); - } + //use glob to get classes (note: GLOB_BRACE doesn't work on some systems) + $results1 = glob($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH . "/*/*/resources/classes/".$class_name.".php"); + $results2 = glob($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH . "/resources/classes/".$class_name.".php"); + $results = array_merge((array)$results1,(array)$results2); + unset($results1, $results2); //include the class foreach ($results as &$class_file) {