From 18623870168ec5cdc9a0cbf37732633ec6830fcc Mon Sep 17 00:00:00 2001 From: gongfuxiang <2499232802@qq.com> Date: Mon, 17 Jun 2019 00:14:10 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=86=E8=8A=82=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extend/base/Qrcode.php | 35 ----------------------------------- 1 file changed, 35 deletions(-) diff --git a/extend/base/Qrcode.php b/extend/base/Qrcode.php index d34de3060..d8d54139a 100644 --- a/extend/base/Qrcode.php +++ b/extend/base/Qrcode.php @@ -211,13 +211,6 @@ class Qrcode { if(!is_dir($dir)) { - // 目录是否有权限 - $ret = $this->IsWritable($dir); - if($ret['code'] != 0) - { - return $ret; - } - // 创建目录 if(mkdir($dir, 0777, true) === false) { @@ -226,33 +219,5 @@ class Qrcode } return DataReturn('操作成功', 0); } - - /** - * 目录是否有权限 - * @author Devil - * @blog http://gong.gg/ - * @version 1.0.0 - * @date 2019-04-19 - * @desc description - * @param [string] $dir [文件路径] - */ - private function IsWritable($dir) - { - $dirs = str_replace($this->config['root_path'], '', $dir); - $dll = explode(DS, $dirs); - if(!empty($dll) && is_array($dll)) - { - $dstr = ''; - foreach($dll as $d) - { - $dstr .= empty($d) ? '' : DS.$d; - if(is_dir($this->config['root_path'].$dstr) && !is_writable($this->config['root_path'].$dstr)) - { - return DataReturn('目录没有权限['.$dstr.']', -1); - } - } - } - return DataReturn('有权限', 0); - } } ?> \ No newline at end of file -- GitLab