recursive_copy function use cp -R if it exists
This commit is contained in:
parent
59e112e7ff
commit
b9643b60ee
|
|
@ -37,7 +37,10 @@ include "root.php";
|
||||||
|
|
||||||
//$option '-n' --no-clobber
|
//$option '-n' --no-clobber
|
||||||
function recursive_copy($src, $dst, $option = '') {
|
function recursive_copy($src, $dst, $option = '') {
|
||||||
|
if (file_exists('/bin/cp')) {
|
||||||
|
exec ('cp -R $option '.$src_dir.' '.$dst_dir);
|
||||||
|
}
|
||||||
|
else {
|
||||||
$dir = opendir($src);
|
$dir = opendir($src);
|
||||||
if (!$dir) {
|
if (!$dir) {
|
||||||
if (!mkdir($src, 0755, true)) {
|
if (!mkdir($src, 0755, true)) {
|
||||||
|
|
@ -70,6 +73,7 @@ include "root.php";
|
||||||
}
|
}
|
||||||
closedir($dir);
|
closedir($dir);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function recursive_delete($dir) {
|
function recursive_delete($dir) {
|
||||||
if (strlen($dir) > 0) {
|
if (strlen($dir) > 0) {
|
||||||
|
|
|
||||||
|
|
@ -1279,8 +1279,6 @@ if ($_POST["install_step"] == "3" && count($_POST) > 0 && strlen($_POST["persist
|
||||||
$install->switch_conf_dir = $switch_conf_dir;
|
$install->switch_conf_dir = $switch_conf_dir;
|
||||||
$install->switch_scripts_dir = $switch_scripts_dir;
|
$install->switch_scripts_dir = $switch_scripts_dir;
|
||||||
$install->switch_sounds_dir = $switch_sounds_dir;
|
$install->switch_sounds_dir = $switch_sounds_dir;
|
||||||
$install->recursive_delete($switch_conf_dir);
|
|
||||||
clearstatcache();
|
|
||||||
$install->copy_conf();
|
$install->copy_conf();
|
||||||
$install->copy();
|
$install->copy();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue