mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-06 11:43:50 +00:00
Make the install and upgrade of the scripts directory included directories, sub directories and files.
This commit is contained in:
@@ -115,23 +115,7 @@ include "root.php";
|
||||
$src_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/includes/install/scripts';
|
||||
$dst_dir = $this->switch_scripts_dir;
|
||||
if (is_readable($this->switch_scripts_dir)) {
|
||||
if ($handle = opendir($src_dir)) {
|
||||
$i = 0;
|
||||
$files = array();
|
||||
while (false !== ($file = readdir($handle))) {
|
||||
if ($file != "." && $file != ".." && is_file($src_dir.'/'.$file)) {
|
||||
if (!file_exists($dst_dir.'/'.$file) ) {
|
||||
//copy the file if it does not exist in the destination directory
|
||||
if (copy($src_dir.'/'.$file, $dst_dir.'/'.$file)) {
|
||||
$this->result['copy']['scripts'][] = "copied from ".$src_dir."/".$file." to ".$dst_dir."/".$file."<br />\n";
|
||||
}
|
||||
else {
|
||||
$this->result['copy']['scripts'][] = "copy failed from ".$src_dir."/".$file." to ".$dst_dir."/".$file."<br />\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->recursive_copy($src_dir, $dst_dir);
|
||||
unset($src_dir, $dst_dir);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -351,8 +351,7 @@ include "root.php";
|
||||
$domain_uuid = $this->domain_uuid;
|
||||
$extension_uuid = $this->extension_uuid;
|
||||
if (strlen($extension_uuid)>0) {
|
||||
$sql = "";
|
||||
$sql .= "delete from v_extensions ";
|
||||
$sql = "delete from v_extensions ";
|
||||
$sql .= "where domain_uuid = '$domain_uuid' ";
|
||||
$sql .= "and extension_uuid = '$extension_uuid' ";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
@@ -368,7 +367,7 @@ include "root.php";
|
||||
$values=array_values($data);
|
||||
for($i=0;$i<$count;$i++){
|
||||
$keys[$i]= str_replace("-", "_", $keys[$i]);
|
||||
$this->{$keys[$i]}=$values[$i];
|
||||
$this->{$keys[$i]}=$values[$i];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user