This commit is contained in:
Mr Chen 2025-01-03 22:15:01 +08:00
parent f6b61c935e
commit 76cf2e8fa5
3 changed files with 8 additions and 6 deletions

View File

@ -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'])

View File

@ -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)

View File

@ -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):