From 76cf2e8fa53286db623674173a54cc88d68ea696 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Fri, 3 Jan 2025 22:15:01 +0800 Subject: [PATCH] update --- plugins/phpmyadmin/index.py | 2 +- plugins/tamper_proof_py/index.py | 9 +++++---- plugins/xhprof/index.py | 3 ++- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/plugins/phpmyadmin/index.py b/plugins/phpmyadmin/index.py index e04e4ecb4..06234631f 100755 --- a/plugins/phpmyadmin/index.py +++ b/plugins/phpmyadmin/index.py @@ -90,7 +90,7 @@ def getHomePage(): def getPhpVer(expect=55): php_vers = MwSites.instance().getPhpVersion() - v = php_ver[0] + v = php_ver['data'] is_find = False for i in range(len(v)): t = str(v[i]['version']) diff --git a/plugins/tamper_proof_py/index.py b/plugins/tamper_proof_py/index.py index 82c06070b..cdeb1050a 100755 --- a/plugins/tamper_proof_py/index.py +++ b/plugins/tamper_proof_py/index.py @@ -16,6 +16,7 @@ if os.path.exists(web_dir): os.chdir(web_dir) import core.mw as mw +from utils.site import sites as MwSites app_debug = False if mw.isAppleSystem(): @@ -560,12 +561,12 @@ class App: return mw.returnJson(False, "此目录不存在") # 判断是否安装php - import site_api - php_version = site_api.site_api().getPhpVersion() - if not php_version: + php_version = MwSites.instance().getPhpVersion() + + if not php_version['data']: return mw.returnJson(False, "未安装PHP测试失败") - php_path = '/www/server/php/' + php_version[1]['version'] + '/bin/php' + php_path = '/www/server/php/' + php_version['data'][1]['version'] + '/bin/php' php_name = path + "/" + str(int(time.time())) + ".php" if os.path.exists(php_name): mw.execShell("rm -rf %s" % php_name) diff --git a/plugins/xhprof/index.py b/plugins/xhprof/index.py index 4b07de2e0..46737af0f 100755 --- a/plugins/xhprof/index.py +++ b/plugins/xhprof/index.py @@ -74,7 +74,8 @@ def getHomePage(): def getPhpVer(expect=74): - v = MwSites.instance().getPhpVersion() + php_vers = MwSites.instance().getPhpVersion() + v = php_ver['data'] for i in range(len(v)): t = int(v[i]['version']) if (t >= expect):