标签:pre span \n read 阿里云 directory style bucket code
cp2oss(_GALLERY_DIR); function cp2oss($directory) { $mydir = dir($directory); while($file = $mydir->read()) { if(is_dir("$directory/$file") && $file != "." && $file != "..") { cp2oss("$directory/$file"); } else if($file != "." && $file != "..") { $dir = ltrim(str_replace(_GALLERY_DIR, ‘‘, $directory),‘/‘); if(!OssUtil::fileExists(OSS_GALLERY_BUCKET, $dir."/".$file)){ echo($dir."/".$file."\n"); echo(_GALLERY_DIR.$dir.‘/‘.$file."\n"); OssUtil::uploadFileToBucket(OSS_GALLERY_BUCKET, $dir."/", $file, _GALLERY_DIR.$dir.‘/‘.$file); } } } $mydir->close(); }
标签:pre span \n read 阿里云 directory style bucket code
原文地址:https://www.cnblogs.com/coffee_cn/p/10256780.html