找到问题,待解决
This commit is contained in:
parent
99f06f9c47
commit
b414ce369f
|
|
@ -251,6 +251,12 @@ class plugins_api:
|
|||
return public.returnJson(True, '安装成功!')
|
||||
public.execShell("rm -rf " + plugin_path)
|
||||
return public.returnJson(False, '安装失败!')
|
||||
|
||||
def phpinfoApi(self):
|
||||
version = request.form.get('version', '')
|
||||
phpinfo = public.httpGet(
|
||||
'http://127.0.0.1/' + version + '/phpinfo.php')
|
||||
return phpinfo
|
||||
##### ----- end ----- ###
|
||||
|
||||
# 进程是否存在
|
||||
|
|
|
|||
|
|
@ -355,13 +355,16 @@ def HttpGet(url, timeout=10):
|
|||
|
||||
|
||||
def HttpGet2(url, timeout):
|
||||
import urllib
|
||||
import urllib2
|
||||
|
||||
req = urllib2.Request(url)
|
||||
res = urllib2.urlopen(req, timeout=timeout)
|
||||
result = res.read()
|
||||
return result
|
||||
try:
|
||||
req = urllib2.Request(url)
|
||||
res = urllib2.urlopen(req, timeout=timeout)
|
||||
result = res.read()
|
||||
return result
|
||||
|
||||
except Exception as e:
|
||||
return str(e)
|
||||
|
||||
|
||||
def httpGet(url, timeout=10):
|
||||
|
|
|
|||
|
|
@ -611,7 +611,7 @@ class site_api:
|
|||
|
||||
# print home_cert
|
||||
cmd = 'export ACCOUNT_EMAIL=' + email + ' && ' + execStr
|
||||
print cmd
|
||||
# print cmd
|
||||
result = public.execShell(cmd)
|
||||
|
||||
if not os.path.exists(home_cert.replace("\*", "*")):
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@ reload(sys)
|
|||
sys.setdefaultencoding('utf8')
|
||||
|
||||
sys.path.append(os.getcwd() + "/class/core")
|
||||
sys.path.append("/usr/local/lib/python2.7/site-packages")
|
||||
|
||||
import public
|
||||
|
||||
app_debug = False
|
||||
|
|
@ -480,28 +482,29 @@ def setDisableFunc(version):
|
|||
return public.returnJson(True, '设置成功!')
|
||||
|
||||
|
||||
def checkPhpinfoFile(version):
|
||||
def checkPhpinfoFile(v):
|
||||
if public.isInstalledWeb():
|
||||
desc_file = public.getServerDir(
|
||||
) + '/openresty/nginx/conf/php_status/phpinfo_' + version + '.conf'
|
||||
desc_file = public.getServerDir() + '/openresty/nginx/conf/php_status/phpinfo_' + \
|
||||
str(v) + '.conf'
|
||||
if not os.path.exists(desc_file):
|
||||
tpl = getPluginDir() + '/conf/phpinfo.conf'
|
||||
content = public.readFile(tpl)
|
||||
content = contentReplace(content, version)
|
||||
content = contentReplace(content, v)
|
||||
public.writeFile(desc_file, content)
|
||||
public.restartWeb()
|
||||
|
||||
|
||||
def getPhpinfo(version):
|
||||
checkPhpinfoFile(version)
|
||||
sPath = public.getRootDir() + '/phpinfo/' + version
|
||||
def getPhpinfo(v):
|
||||
checkPhpinfoFile(v)
|
||||
sPath = public.getRootDir() + '/phpinfo/' + str(v)
|
||||
# public.execShell("rm -rf " + public.getRootDir() + '/phpinfo')
|
||||
public.execShell("mkdir -p " + sPath)
|
||||
public.writeFile(sPath + '/phpinfo.php', '<?php phpinfo(); ?>')
|
||||
# print 'http://127.0.0.1/' + version + '/phpinfo.php'
|
||||
phpinfo = public.httpGet('http://127.0.0.1/' + version + '/phpinfo.php', 3)
|
||||
# print 'http://127.0.0.1/' + str(v) + '/phpinfo.php'
|
||||
phpinfo = public.httpGet('http://127.0.0.1/' + str(v) + '/phpinfo.php')
|
||||
public.writeFile('/tmp/phpinfo.txt', phpinfo)
|
||||
# os.system("rm -rf " + public.getRootDir() + '/phpinfo')
|
||||
return phpinfo
|
||||
return ''
|
||||
|
||||
|
||||
def getLibConf(version):
|
||||
|
|
|
|||
|
|
@ -373,7 +373,7 @@ function setDisableFunc(version, act, fs) {
|
|||
|
||||
//phpinfo
|
||||
function getPhpinfo(version) {
|
||||
var con = '<button class="btn btn-default btn-sm" onclick="getPHPInfo(\'' + version + '\')">' + lan.soft.phpinfo + '</button>';
|
||||
var con = '<button class="btn btn-default btn-sm" onclick="getPHPInfo(\'' + version + '\')">查看phpinfo()</button>';
|
||||
$(".soft-man-con").html(con);
|
||||
}
|
||||
|
||||
|
|
@ -392,6 +392,20 @@ function getPHPInfo(version) {
|
|||
});
|
||||
}
|
||||
|
||||
//获取PHPInfo
|
||||
function getPHPInfo_new(version) {
|
||||
$.post('/plugins/phpinfo', {v:version}, function(data) {
|
||||
layer.open({
|
||||
type: 1,
|
||||
title: "PHP-" + version + "-PHPINFO",
|
||||
area: ['90%', '90%'],
|
||||
closeBtn: 2,
|
||||
shadeClose: true,
|
||||
content: data
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function phpLibConfig(version){
|
||||
|
||||
phpPost('get_lib_conf', version, '', function(data){
|
||||
|
|
|
|||
|
|
@ -6,10 +6,9 @@ import sys
|
|||
import os
|
||||
chdir = os.getcwd()
|
||||
sys.path.append(chdir + '/class/core')
|
||||
sys.path.append("/usr/local/lib/python2.7/site-packages")
|
||||
# sys.path.append("/usr/local/lib/python2.7/site-packages")
|
||||
import public
|
||||
import system_api
|
||||
|
||||
# cpu_info = system_api.system_api().getCpuInfo()
|
||||
# workers = cpu_info[1] + 1
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue