Update functions.php
This commit is contained in:
parent
140a52b3e5
commit
70e550ea72
|
|
@ -163,7 +163,8 @@
|
||||||
if (strtoupper(substr(PHP_OS, 0, 3)) === 'SUN') {
|
if (strtoupper(substr(PHP_OS, 0, 3)) === 'SUN') {
|
||||||
//copy -R recursive, preserve attributes for SUN
|
//copy -R recursive, preserve attributes for SUN
|
||||||
$cmd = 'cp -Rp '.$source.'/* '.$destination;
|
$cmd = 'cp -Rp '.$source.'/* '.$destination;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
//copy -R recursive, -L follow symbolic links, -p preserve attributes for other Posix systemss
|
//copy -R recursive, -L follow symbolic links, -p preserve attributes for other Posix systemss
|
||||||
$cmd = 'cp -RLp '.$options.' '.$source.'/* '.$destination;
|
$cmd = 'cp -RLp '.$options.' '.$source.'/* '.$destination;
|
||||||
}
|
}
|
||||||
|
|
@ -178,7 +179,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
function recursive_copy($source, $destination, $options = '') {
|
function recursive_copy($source, $destination, $options = '') {
|
||||||
$dir = opendir($source);
|
$dir = opendir($source);
|
||||||
if (!$dir) {
|
if (!$dir) {
|
||||||
|
|
@ -202,31 +202,35 @@
|
||||||
closedir($dir);
|
closedir($dir);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!function_exists('recursive_delete')) {
|
if (!function_exists('recursive_delete')) {
|
||||||
if (file_exists('/bin/rm')) {
|
if (file_exists('/bin/rm')) {
|
||||||
function recursive_delete($dir) {
|
function recursive_delete($directory) {
|
||||||
//$this->write_debug('rm -Rf '.$dir.'/*');
|
if (isset($directory) && strlen($directory) > 8) {
|
||||||
exec ('rm -Rf '.$dir.'/*');
|
exec ('find '.$directory.' -name "*" | xargs rm -Rf');
|
||||||
clearstatcache();
|
//exec ('rm -Rf '.$directory.'/*');
|
||||||
|
clearstatcache();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}elseif(strtoupper(substr(PHP_OS, 0, 3)) === 'WIN'){
|
}
|
||||||
function recursive_delete($dir) {
|
elseif (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
|
||||||
$dst = normalize_path_to_os($dst);
|
function recursive_delete($directory) {
|
||||||
|
$directory = normalize_path_to_os($directory);
|
||||||
//$this->write_debug("del /S /F /Q \"$dir\"");
|
//$this->write_debug("del /S /F /Q \"$dir\"");
|
||||||
exec("del /S /F /Q \"$dir\"");
|
exec("del /S /F /Q \"$directory\"");
|
||||||
clearstatcache();
|
clearstatcache();
|
||||||
}
|
}
|
||||||
}else{
|
}
|
||||||
function recursive_delete($dir) {
|
else {
|
||||||
foreach (glob($dir) as $file) {
|
function recursive_delete($directory) {
|
||||||
|
foreach (glob($directory) as $file) {
|
||||||
if (is_dir($file)) {
|
if (is_dir($file)) {
|
||||||
//$this->write_debug("rm dir: ".$file);
|
//$this->write_debug("rm dir: ".$file);
|
||||||
recursive_delete("$file/*");
|
recursive_delete("$file/*");
|
||||||
rmdir($file);
|
rmdir($file);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
//$this->write_debug("delete file: ".$file);
|
//$this->write_debug("delete file: ".$file);
|
||||||
unlink($file);
|
unlink($file);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue