Update the dev branch version to 3.7 and get rid of GLOB_BRACE which is not defined in Solaris

This commit is contained in:
Mark Crane
2014-08-19 09:16:01 +00:00
parent c7f56a53ab
commit e9993f4c3e
3 changed files with 23 additions and 3 deletions

View File

@@ -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));

View File

@@ -26,7 +26,7 @@
if (!function_exists('software_version')) {
function software_version() {
return '3.6.0';
return '3.7.0';
}
}

View File

@@ -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();