Skip to content

Commit c347e1b

Browse files
committed
update
1 parent be4570e commit c347e1b

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

plugins/php/index.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -446,21 +446,23 @@ def setMaxTime(version):
446446

447447
def setMaxSize(version):
448448
args = getArgs()
449-
if not 'max' in args:
450-
return 'missing time args!'
451-
max = args['max']
452-
if int(max) < 2:
449+
data = checkArgs(args, ['max'])
450+
if not data[0]:
451+
return data[1]
452+
453+
maxVal = args['max']
454+
if int(maxVal) < 2:
453455
return mw.returnJson(False, '上传大小限制不能小于2MB!')
454456

455457
path = getServerDir() + '/' + version + '/etc/php.ini'
456458
conf = mw.readFile(path)
457459
rep = u"\nupload_max_filesize\s*=\s*[0-9]+M"
458-
conf = re.sub(rep, u'\nupload_max_filesize = ' + max + 'M', conf)
460+
conf = re.sub(rep, u'\nupload_max_filesize = ' + maxVal + 'M', conf)
459461
rep = u"\npost_max_size\s*=\s*[0-9]+M"
460-
conf = re.sub(rep, u'\npost_max_size = ' + max + 'M', conf)
462+
conf = re.sub(rep, u'\npost_max_size = ' + maxVal + 'M', conf)
461463
mw.writeFile(path, conf)
462464

463-
msg = mw.getInfo('设置PHP-{1}最大上传大小为[{2}MB]!', (version, max,))
465+
msg = mw.getInfo('设置PHP-{1}最大上传大小为[{2}MB]!', (version, maxVal,))
464466
mw.writeLog('插件管理[PHP]', msg)
465467
return mw.returnJson(True, '设置成功!')
466468

plugins/php/init.d/php52.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
php_fpm_BIN=/www/server/php/52/bin/php-cgi
44
php_fpm_CONF=/www/server/php/52/etc/php-fpm.conf
5-
php_fpm_PID=/www/server/php/52/logs/php-fpm.pid
5+
php_fpm_PID=/www/server/php/52//var/log/php-fpm.pid
66

77

88
php_opts="--fpm-config $php_fpm_CONF"

0 commit comments

Comments
 (0)