pull/109/head
Mr Chen 6 years ago
parent 63e272c4c6
commit 70032ea69e
  1. 6
      class/core/public.py
  2. 13
      plugins/php/index.py

@ -80,6 +80,12 @@ def isInstalledWeb():
return False
def restartWeb():
if isInstalledWeb():
initd = getServerDir() + '/openresty/init.d/openresty'
execShell(initd + ' ' + 'reload')
def M(table):
sql = db.Sql()
return sql.table(table)

@ -399,7 +399,20 @@ def setFpmConfig(version):
return public.returnJson(True, '设置成功')
def checkFpmStatusFile(version):
if public.isInstalledWeb():
desc_file = public.getServerDir(
) + '/openresty/nginx/conf/php_status/phpfpm_status_' + version + '.conf'
if not os.path.exists(desc_file):
tpl = getPluginDir() + '/conf/phpfpm_status.conf'
content = public.readFile(tpl)
content = contentReplace(content, version)
public.writeFile(desc_file, content)
public.restartWeb()
def getFpmStatus(version):
checkFpmStatusFile(version)
result = public.httpGet(
'http://127.0.0.1/phpfpm_status_' + version + '?json')

Loading…
Cancel
Save