mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-06 19:53:56 +00:00
patch for SunOS
corrected collection of switch version during detect_switch
This commit is contained in:
@@ -87,11 +87,13 @@ $document['title'] = $text['title-sys-status'];
|
|||||||
|
|
||||||
$git_path = normalize_path_to_os($_SERVER["DOCUMENT_ROOT"]."/.git");
|
$git_path = normalize_path_to_os($_SERVER["DOCUMENT_ROOT"]."/.git");
|
||||||
if(file_exists($git_path)){
|
if(file_exists($git_path)){
|
||||||
$git_branch = shell_exec('git --git-dir='.$git_path.' name-rev --name-only HEAD');
|
$git_exe = 'git';
|
||||||
|
if (strtoupper(substr(PHP_OS, 0, 3)) === 'SUN') { $git_exe = shell_exec('which git')); }
|
||||||
|
$git_branch = shell_exec($git_exe.' --git-dir='.$git_path.' name-rev --name-only HEAD');
|
||||||
rtrim($git_branch);
|
rtrim($git_branch);
|
||||||
$git_commit = shell_exec('git --git-dir='.$git_path.' rev-parse HEAD');
|
$git_commit = shell_exec($git_exe.' --git-dir='.$git_path.' rev-parse HEAD');
|
||||||
rtrim($git_commit);
|
rtrim($git_commit);
|
||||||
$git_origin = shell_exec('git --git-dir='.$git_path.' config --get remote.origin.url');
|
$git_origin = shell_exec($git_exe.' --git-dir='.$git_path.' config --get remote.origin.url');
|
||||||
rtrim($git_commit);
|
rtrim($git_commit);
|
||||||
echo "<tr>\n";
|
echo "<tr>\n";
|
||||||
echo " <td width='20%' class=\"vncell\" style='text-align: left;'>\n";
|
echo " <td width='20%' class=\"vncell\" style='text-align: left;'>\n";
|
||||||
|
|||||||
@@ -128,10 +128,11 @@ require_once "resources/classes/EventSocket.php";
|
|||||||
throw new Exception('Failed to use event socket');
|
throw new Exception('Failed to use event socket');
|
||||||
}
|
}
|
||||||
$FS_Version = $this->event_socket_request('api version');
|
$FS_Version = $this->event_socket_request('api version');
|
||||||
preg_match("/FreeSWITCH Version (\d+\.\d+\.\d+(?:\.\d+)?).*\(.*?(\d+\w+)\s*\)/", $FS_Version, $matches);
|
preg_match("/FreeSWITCH Version (\d+)\.(\d+)\.(\d+(?:\.\d+)?).*\(.*?(\d+\w+)\s*\)/", $FS_Version, $matches);
|
||||||
$this->_major = $matches[1];
|
$this->_major = $matches[1];
|
||||||
$this->_minor = $matches[2];
|
$this->_minor = $matches[2];
|
||||||
$this->_build = $matches[3];
|
$this->_build = $matches[3];
|
||||||
|
$this->_bits = $matches[4];
|
||||||
$FS_Vars = $this->event_socket_request('api global_getvar');
|
$FS_Vars = $this->event_socket_request('api global_getvar');
|
||||||
foreach (explode("\n",$FS_Vars) as $FS_Var){
|
foreach (explode("\n",$FS_Vars) as $FS_Var){
|
||||||
preg_match("/(\w+_dir)=(.*)/", $FS_Var, $matches);
|
preg_match("/(\w+_dir)=(.*)/", $FS_Var, $matches);
|
||||||
|
|||||||
Reference in New Issue
Block a user