From e9993f4c3ee14c605c4bb9da32d5aa19df6200b9 Mon Sep 17 00:00:00 2001 From: Mark Crane Date: Tue, 19 Aug 2014 09:16:01 +0000 Subject: [PATCH] Update the dev branch version to 3.7 and get rid of GLOB_BRACE which is not defined in Solaris --- .../resources/classes/switch_music_on_hold.php | 12 +++++++++++- resources/functions.php | 2 +- resources/require.php | 12 +++++++++++- 3 files changed, 23 insertions(+), 3 deletions(-) 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 7e5ccf55c3..ce59d72863 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 @@ -136,7 +136,17 @@ include "root.php"; //build the list of categories $music_on_hold_dir = $_SESSION['switch']['sounds']['dir'].'/music'; //default category - $array = glob($music_on_hold_dir."/{8000,16000,32000,48000}", GLOB_ONLYDIR|GLOB_BRACE); + 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); + } //other categories if (count($_SESSION['domains']) > 1) { $array = array_merge($array, glob($music_on_hold_dir."/*/*/*", GLOB_ONLYDIR)); diff --git a/resources/functions.php b/resources/functions.php index 96e5801be1..2a3e62d4dc 100644 --- a/resources/functions.php +++ b/resources/functions.php @@ -26,7 +26,7 @@ if (!function_exists('software_version')) { function software_version() { - return '3.6.0'; + return '3.7.0'; } } diff --git a/resources/require.php b/resources/require.php index 068bdb948a..b8c2c3a342 100644 --- a/resources/require.php +++ b/resources/require.php @@ -48,13 +48,23 @@ } private function loader($class_name) { //use glob to check "/resources/classes", "/{core,app}/*/resources/classes"; - $results = glob($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH . "{/*/*,}/resources/classes/".$class_name.".php", GLOB_BRACE); + 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); + } + //include the class foreach ($results as &$class_file) { if (!class_exists($class_name)) { include $class_file; } } + unset($results); } } $autoload = new auto_loader();