/**
* copy 文件夹
* @param $source 源文件目录
* @param $destination 复制目录
* @param int $child 类型 1包括子目录 0不包括子目录
* @return int
*/
public function xCopy($source, $destination, $child = 1)
{
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;
}