//复制文件
function xCopy($source, $destination, $child){
if (!file_exists($destination))
{
if (!mkdir(rtrim($destination, '/'), 0777))
{
//$err->add($_LANG['cannt_mk_dir']);
return false;
}
@chmod($destination, 0777);
}
if(!is_dir($source)){
return 0;
}
if(!is_dir($destination)){
mkdir($destination,0777);
}
$handle=dir($source);
while($entry=$handle->read()){
if(($entry!=".")&&($entry!="..")){
if(is_dir($source."/".$entry)){
if($child)
$this->xCopy($source."/".$entry,$destination."/".$entry,$child);
}
else{
copy($source."/".$entry,$destination."/".$entry);
}
}
}
return 1;
}
function xCopy($source, $destination, $child){
if (!file_exists($destination))
{
if (!mkdir(rtrim($destination, '/'), 0777))
{
//$err->add($_LANG['cannt_mk_dir']);
return false;
}
@chmod($destination, 0777);
}
if(!is_dir($source)){
return 0;
}
if(!is_dir($destination)){
mkdir($destination,0777);
}
$handle=dir($source);
while($entry=$handle->read()){
if(($entry!=".")&&($entry!="..")){
if(is_dir($source."/".$entry)){
if($child)
$this->xCopy($source."/".$entry,$destination."/".$entry,$child);
}
else{
copy($source."/".$entry,$destination."/".$entry);
}
}
}
return 1;
}