Skip to content

Commit

Permalink
调整目录删除过程
Browse files Browse the repository at this point in the history
  • Loading branch information
showpy committed Jul 3, 2019
1 parent 13095d6 commit 967092e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions class/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,9 @@ def DeleteDir(self,get) :

try:
#检查是否存在.user.ini
if os.path.exists(get.path+'/.user.ini'):
os.system("chattr -i '"+get.path+"/.user.ini'")
#if os.path.exists(get.path+'/.user.ini'):
# os.system("chattr -i '"+get.path+"/.user.ini'")
os.system("chattr -R -i " + get.path)
if hasattr(get,'empty'):
if not self.delete_empty(get.path): return public.returnMsg(False,'DIR_ERR_NOT_EMPTY');

Expand Down Expand Up @@ -883,6 +884,7 @@ def SetBatchData(self,get):
public.writeSpeed(key,i,l);
if os.path.isdir(filename):
if not self.CheckDir(filename): return public.returnMsg(False,'FILE_DANGER');
os.system("chattr -R -i " + filename)
if isRecyle:
self.Mv_Recycle_bin(get)
else:
Expand Down
4 changes: 3 additions & 1 deletion class/plugin_deployment.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ def SetupPackage(self,get):
self.WriteLogs(json.dumps({'name':'安装必要的PHP扩展','total':0,'used':0,'pre':0,'speed':0}));
import files
mfile = files.files();
pinfo['php_ext'] = pinfo['php_ext'].strip().split(',')
if type(pinfo['php_ext']) == str : pinfo['php_ext'] = pinfo['php_ext'].strip().split(',')
for ext in pinfo['php_ext']:
if ext == 'pathinfo':
import config
Expand All @@ -302,6 +302,7 @@ def SetupPackage(self,get):
#解禁PHP函数
if 'enable_functions' in pinfo:
try:
if type(pinfo['enable_functions']) == str : pinfo['enable_functions'] = pinfo['enable_functions'].strip().split(',')
php_f = public.GetConfigValue('setup_path') + '/php/' + php_version + '/etc/php.ini'
php_c = public.readFile(php_f)
rep = "disable_functions\s*=\s{0,1}(.*)\n"
Expand Down Expand Up @@ -382,6 +383,7 @@ def SetupPackage(self,get):

#清理文件和目录
self.WriteLogs(json.dumps({'name':'清理多余的文件','total':0,'used':0,'pre':0,'speed':0}));
if type(pinfo['remove_file']) == str : pinfo['remove_file'] = pinfo['remove_file'].strip().split(',')
for f_path in pinfo['remove_file']:
filename = (path + '/' + f_path).replace('//','/')
if os.path.exists(filename):
Expand Down

0 comments on commit 967092e

Please sign in to comment.