perf: 优化客户端升级
This commit is contained in:
@@ -13,7 +13,6 @@ use League\CommonMark\Exception\CommonMarkException;
|
||||
use Overtrue\Pinyin\Pinyin;
|
||||
use Redirect;
|
||||
use Request;
|
||||
use Response;
|
||||
use Storage;
|
||||
use Symfony\Component\HttpFoundation\File\Exception\FileException;
|
||||
use Symfony\Component\HttpFoundation\File\File;
|
||||
@@ -372,6 +371,34 @@ class Base
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 复制文件夹
|
||||
* @param $source
|
||||
* @param $destination
|
||||
* @return bool
|
||||
*/
|
||||
public static function copyDirectory($source, $destination)
|
||||
{
|
||||
if (!is_dir($source)) {
|
||||
return false;
|
||||
}
|
||||
if (!is_dir($destination)) {
|
||||
Base::makeDir($destination);
|
||||
}
|
||||
$dir = opendir($source);
|
||||
while (false !== ($file = readdir($dir))) {
|
||||
if (($file != '.') && ($file != '..')) {
|
||||
if (is_dir($source . '/' . $file)) {
|
||||
self::copyDirectory($source . '/' . $file, $destination . '/' . $file);
|
||||
} else {
|
||||
copy($source . '/' . $file, $destination . '/' . $file);
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($dir);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* 截取字符串
|
||||
|
||||
Reference in New Issue
Block a user