mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-10 04:59:25 +08:00
phpinfo ok
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
location /{$PHP_VERSION} {
|
||||
root {$ROOT_PATH}/phpinfo;
|
||||
include enable-php-{$PHP_VERSION}.conf;
|
||||
}
|
||||
@@ -13,7 +13,7 @@
|
||||
<p onclick="getFpmStatus($('.plugin_version').attr('version'));">负载状况</p>
|
||||
<p onclick="pluginLogs('php',$('.plugin_version').attr('version'),'fpm_log');">FPM日志</p>
|
||||
<p onclick="pluginLogs('php',$('.plugin_version').attr('version'),'fpm_slow_log');">慢日志</p>
|
||||
<p onclick="redisStatus();">PHPIFNO</p>
|
||||
<p onclick="getPhpinfo($('.plugin_version').attr('version'));">PHPIFNO</p>
|
||||
</div>
|
||||
<div class="bt-w-con pd15">
|
||||
<div class="soft-man-con"></div>
|
||||
|
||||
@@ -70,6 +70,7 @@ def status(version):
|
||||
|
||||
def contentReplace(content, version):
|
||||
service_path = public.getServerDir()
|
||||
content = content.replace('{$ROOT_PATH}', public.getRootDir())
|
||||
content = content.replace('{$SERVER_PATH}', service_path)
|
||||
content = content.replace('{$PHP_VERSION}', version)
|
||||
|
||||
@@ -453,6 +454,29 @@ def setDisableFunc(version):
|
||||
return public.returnJson(True, '设置成功!')
|
||||
|
||||
|
||||
def checkPhpinfoFile(version):
|
||||
if public.isInstalledWeb():
|
||||
desc_file = public.getServerDir(
|
||||
) + '/openresty/nginx/conf/php_status/phpinfo_' + version + '.conf'
|
||||
if not os.path.exists(desc_file):
|
||||
tpl = getPluginDir() + '/conf/phpinfo.conf'
|
||||
content = public.readFile(tpl)
|
||||
content = contentReplace(content, version)
|
||||
public.writeFile(desc_file, content)
|
||||
public.restartWeb()
|
||||
|
||||
|
||||
def getPhpinfo(version):
|
||||
checkPhpinfoFile(version)
|
||||
sPath = public.getRootDir() + '/phpinfo/' + version
|
||||
public.execShell("rm -rf " + public.getRootDir() + '/phpinfo')
|
||||
public.execShell("mkdir -p " + sPath)
|
||||
public.writeFile(sPath + '/phpinfo.php', '<?php phpinfo(); ?>')
|
||||
phpinfo = public.httpGet('http://127.0.0.1/' + version + '/phpinfo.php')
|
||||
os.system("rm -rf " + public.getRootDir() + '/phpinfo')
|
||||
return phpinfo
|
||||
|
||||
|
||||
def getLibConf(version):
|
||||
fname = public.getServerDir() + '/php/' + version + '/etc/php.ini'
|
||||
if not os.path.exists(filename):
|
||||
@@ -520,6 +544,8 @@ if __name__ == "__main__":
|
||||
print getDisableFunc(version)
|
||||
elif func == 'set_disable_func':
|
||||
print setDisableFunc(version)
|
||||
elif func == 'get_phpinfo':
|
||||
print getPhpinfo(version)
|
||||
elif func == 'get_lib_conf':
|
||||
print getLibConf(version)
|
||||
else:
|
||||
|
||||
+21
-22
@@ -359,6 +359,27 @@ 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>';
|
||||
$(".soft-man-con").html(con);
|
||||
}
|
||||
|
||||
//获取PHPInfo
|
||||
function getPHPInfo(version) {
|
||||
phpPost('get_phpinfo', version, '', function(data){
|
||||
var rdata = data.data;
|
||||
layer.open({
|
||||
type: 1,
|
||||
title: "PHP-" + version + "-PHPINFO",
|
||||
area: ['90%', '90%'],
|
||||
closeBtn: 2,
|
||||
shadeClose: true,
|
||||
content: rdata
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function phpLibConfig(version){
|
||||
|
||||
}
|
||||
@@ -479,26 +500,4 @@ function UninstallPHPLib(version, name, title, pathinfo) {
|
||||
SetPHPConfig(version, pathinfo, true);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
//phpinfo
|
||||
function BtPhpinfo(version) {
|
||||
var con = '<button class="btn btn-default btn-sm" onclick="GetPHPInfo(\'' + version + '\')">' + lan.soft.phpinfo + '</button>';
|
||||
$(".soft-man-con").html(con);
|
||||
}
|
||||
|
||||
//获取PHPInfo
|
||||
function GetPHPInfo(version) {
|
||||
var loadT = layer.msg(lan.soft.get, { icon: 16, time: 0, shade: [0.3, '#000'] });
|
||||
$.get('/ajax?action=GetPHPInfo&version=' + version, function(rdata) {
|
||||
layer.close(loadT);
|
||||
layer.open({
|
||||
type: 1,
|
||||
title: "PHP-" + version + "-PHPINFO",
|
||||
area: ['70%', '90%'],
|
||||
closeBtn: 2,
|
||||
shadeClose: true,
|
||||
content: rdata.replace('a:link {color: #009; text-decoration: none; background-color: #fff;}', '').replace('a:link {color: #000099; text-decoration: none; background-color: #ffffff;}', '')
|
||||
});
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user