Fix the indentation and improve the comments
This commit is contained in:
@@ -38,10 +38,11 @@ include "root.php";
|
|||||||
//$option '-n' --no-clobber
|
//$option '-n' --no-clobber
|
||||||
public function recursive_copy($src, $dst, $option = '') {
|
public function recursive_copy($src, $dst, $option = '') {
|
||||||
if (file_exists('/bin/cp')) {
|
if (file_exists('/bin/cp')) {
|
||||||
// here we are checking if the OS is SUN since the copy command is slightly different
|
|
||||||
if (strtoupper(substr(PHP_OS, 0, 3)) === 'SUN') {
|
if (strtoupper(substr(PHP_OS, 0, 3)) === 'SUN') {
|
||||||
|
//copy -R recursive, preserve attributes for SUN
|
||||||
exec ('cp -Rp '.$src.'/* '.$dst);
|
exec ('cp -Rp '.$src.'/* '.$dst);
|
||||||
} else { //not sun system
|
} else {
|
||||||
|
//copy -R recursive, -L follow symbolic links, -p preserve attributes for other Posix systemss
|
||||||
exec ('cp -RLp '.$option.' '.$src.'/* '.$dst);
|
exec ('cp -RLp '.$option.' '.$src.'/* '.$dst);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user