mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-18 23:45:52 +08:00
优化
This commit is contained in:
@@ -512,10 +512,10 @@ def setDisableFunc(version):
|
|||||||
|
|
||||||
phpini = public.readFile(filename)
|
phpini = public.readFile(filename)
|
||||||
rep = "disable_functions\s*=\s*.*\n"
|
rep = "disable_functions\s*=\s*.*\n"
|
||||||
phpini = re.sub(rep, 'disable_functions = ' +
|
phpini = re.sub(rep, 'disable_functions = ' +disable_functions + "\n", phpini)
|
||||||
disable_functions + "\n", phpini)
|
|
||||||
public.writeLog('TYPE_PHP', 'PHP_DISABLE_FUNCTION',
|
msg = public.getInfo('修改PHP-{1}的禁用函数为[{2}]',(version, disable_functions,))
|
||||||
(version, disable_functions))
|
public.writeLog('插件管理[PHP]', msg)
|
||||||
public.writeFile(filename, phpini)
|
public.writeFile(filename, phpini)
|
||||||
reload(version)
|
reload(version)
|
||||||
return public.returnJson(True, '设置成功!')
|
return public.returnJson(True, '设置成功!')
|
||||||
@@ -523,13 +523,13 @@ def setDisableFunc(version):
|
|||||||
|
|
||||||
def checkPhpinfoFile(v):
|
def checkPhpinfoFile(v):
|
||||||
if public.isInstalledWeb():
|
if public.isInstalledWeb():
|
||||||
desc_file = public.getServerDir(
|
sdir = public.getServerDir()
|
||||||
) + '/openresty/nginx/conf/php_status/phpinfo_' + v + '.conf'
|
dfile = sdir + '/openresty/nginx/conf/php_status/phpinfo_' + v + '.conf'
|
||||||
if not os.path.exists(desc_file):
|
if not os.path.exists(dfile):
|
||||||
tpl = getPluginDir() + '/conf/phpinfo.conf'
|
tpl = getPluginDir() + '/conf/phpinfo.conf'
|
||||||
content = public.readFile(tpl)
|
content = public.readFile(tpl)
|
||||||
content = contentReplace(content, v)
|
content = contentReplace(content, v)
|
||||||
public.writeFile(desc_file, content)
|
public.writeFile(dfile, content)
|
||||||
public.restartWeb()
|
public.restartWeb()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -386,7 +386,7 @@ def startPHPVersion(version):
|
|||||||
#尝试重启服务
|
#尝试重启服务
|
||||||
cgi = '/tmp/php-cgi-'+version + '.sock'
|
cgi = '/tmp/php-cgi-'+version + '.sock'
|
||||||
pid = sdir+'/php/'+version+'/var/run/php-fpm.pid';
|
pid = sdir+'/php/'+version+'/var/run/php-fpm.pid';
|
||||||
#os.system('ps -ef | grep php/'+version+' | grep -v grep|grep -v python |awk "{print $2}"|xargs kill')
|
os.system("ps -ef | grep php/"+version+" | grep -v grep|grep -v python |awk '{print $2}'|xargs kill")
|
||||||
time.sleep(0.5);
|
time.sleep(0.5);
|
||||||
if not os.path.exists(cgi): os.system('rm -f ' + cgi);
|
if not os.path.exists(cgi): os.system('rm -f ' + cgi);
|
||||||
if not os.path.exists(pid): os.system('rm -f ' + pid);
|
if not os.path.exists(pid): os.system('rm -f ' + pid);
|
||||||
|
|||||||
Reference in New Issue
Block a user