From 70032ea69e54b49b68e731bcbc1ecd9392e8ec1f Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 19 Dec 2018 15:41:00 +0800 Subject: [PATCH] update --- class/core/public.py | 6 ++++++ plugins/php/index.py | 13 +++++++++++++ 2 files changed, 19 insertions(+) diff --git a/class/core/public.py b/class/core/public.py index c4d1e20b6..06d2db3ee 100755 --- a/class/core/public.py +++ b/class/core/public.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) diff --git a/plugins/php/index.py b/plugins/php/index.py index 2200d4c7d..6555f1c6e 100755 --- a/plugins/php/index.py +++ b/plugins/php/index.py @@ -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')