mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-18 23:45:52 +08:00
update
This commit is contained in:
@@ -154,7 +154,7 @@ bcmath.scale = 0
|
||||
|
||||
[Session]
|
||||
session.save_handler = files
|
||||
session.save_path = "MD:/bin/tmp/session"
|
||||
session.save_path = "/tmp/session"
|
||||
session.use_strict_mode = 0
|
||||
session.use_cookies = 1
|
||||
session.use_only_cookies = 1
|
||||
|
||||
@@ -37,6 +37,8 @@ cd $sourcePath/php/php-5.6.36 && ./configure \
|
||||
--exec-prefix=$serverPath/php/56 \
|
||||
--with-config-file-path=$serverPath/php/56/etc \
|
||||
--with-zlib-dir=$serverPath/lib/zlib \
|
||||
--with-mysql \
|
||||
--with-mysqli \
|
||||
--without-iconv \
|
||||
--enable-zip \
|
||||
--enable-mbstring \
|
||||
@@ -45,7 +47,7 @@ cd $sourcePath/php/php-5.6.36 && ./configure \
|
||||
--enable-soap \
|
||||
--enable-posix \
|
||||
--enable-fpm \
|
||||
&& make && make install
|
||||
&& make && make install && make clean
|
||||
|
||||
#------------------------ install end ------------------------------------#
|
||||
}
|
||||
|
||||
Executable
+27
@@ -0,0 +1,27 @@
|
||||
server
|
||||
{
|
||||
listen 888;
|
||||
server_name www.bt.cn;
|
||||
index index.html index.htm index.php;
|
||||
root {$SERVER_PATH}/phpmyadmin;
|
||||
|
||||
#error_page 404 /404.html;
|
||||
include enable-php-{$PHP_VER}.conf;
|
||||
|
||||
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
|
||||
{
|
||||
expires 30d;
|
||||
}
|
||||
|
||||
location ~ .*\.(js|css)?$
|
||||
{
|
||||
expires 12h;
|
||||
}
|
||||
|
||||
location ~ /\.
|
||||
{
|
||||
deny all;
|
||||
}
|
||||
|
||||
access_log off;
|
||||
}
|
||||
@@ -1,8 +1,10 @@
|
||||
<div class="bt-form">
|
||||
<div class="bt-w-main">
|
||||
<div class="bt-w-menu">
|
||||
<p class="bgw" onclick="pluginService('mysql');">php版本</p>
|
||||
<p onclick="pluginInitD('mysql');">安全设置</p>
|
||||
<p class="bgw" onclick="pluginService('phpmyadmin');">服务</p>
|
||||
<p onclick="pluginService('phpmyadmin');">重新模版</p>
|
||||
<p onclick="">PHP版本</p>
|
||||
<p onclick="">安全设置</p>
|
||||
</div>
|
||||
<div class="bt-w-con pd15">
|
||||
<div class="soft-man-con"></div>
|
||||
@@ -11,6 +13,6 @@
|
||||
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
pluginService('mysql');
|
||||
pluginService('phpmyadmin');
|
||||
$.getScript( "/plugins/file?name=phpmyadmin&f=js/phpmyadmin.js");
|
||||
</script>
|
||||
Executable
+133
@@ -0,0 +1,133 @@
|
||||
# coding:utf-8
|
||||
|
||||
import sys
|
||||
import io
|
||||
import os
|
||||
import time
|
||||
import re
|
||||
|
||||
sys.path.append(os.getcwd() + "/class/core")
|
||||
import public
|
||||
import site_api
|
||||
|
||||
app_debug = False
|
||||
if public.isAppleSystem():
|
||||
app_debug = True
|
||||
|
||||
|
||||
def getPluginName():
|
||||
return 'phpmyadmin'
|
||||
|
||||
|
||||
def getPluginDir():
|
||||
return public.getPluginDir() + '/' + getPluginName()
|
||||
|
||||
|
||||
def getServerDir():
|
||||
return public.getServerDir() + '/' + getPluginName()
|
||||
|
||||
|
||||
def getArgs():
|
||||
args = sys.argv[2:]
|
||||
tmp = {}
|
||||
args_len = len(args)
|
||||
|
||||
if args_len == 1:
|
||||
t = args[0].strip('{').strip('}')
|
||||
t = t.split(':')
|
||||
tmp[t[0]] = t[1]
|
||||
elif args_len > 1:
|
||||
for i in range(len(args)):
|
||||
t = args[i].split(':')
|
||||
tmp[t[0]] = t[1]
|
||||
|
||||
return tmp
|
||||
|
||||
|
||||
def getConf():
|
||||
return public.getServerDir() + '/openresty/nginx/conf/vhost/phpmyadmin.conf'
|
||||
|
||||
#{$PHP_VERSION}
|
||||
|
||||
|
||||
def getPhpVer(expect=55):
|
||||
import json
|
||||
v = site_api.site_api().getPhpVersion()
|
||||
v = json.loads(v)
|
||||
for i in range(len(v)):
|
||||
t = int(v[i]['version'])
|
||||
if (t >= expect):
|
||||
return str(t)
|
||||
return str(expect)
|
||||
|
||||
|
||||
def getCachePhpVer():
|
||||
cacheFile = getServerDir() + '/php.pl'
|
||||
v = ''
|
||||
if os.path.exists(cacheFile):
|
||||
v = public.readFile(cacheFile)
|
||||
else:
|
||||
v = getPhpVer()
|
||||
public.writeFile(cacheFile, v)
|
||||
return v
|
||||
|
||||
|
||||
def contentReplace(content):
|
||||
service_path = public.getServerDir()
|
||||
php_ver = getCachePhpVer()
|
||||
# print php_ver
|
||||
content = content.replace('{$ROOT_PATH}', public.getRootDir())
|
||||
content = content.replace('{$SERVER_PATH}', service_path)
|
||||
content = content.replace('{$PHP_VER}', php_ver)
|
||||
return content
|
||||
|
||||
|
||||
def status():
|
||||
conf = getConf()
|
||||
if os.path.exists(conf):
|
||||
return 'start'
|
||||
return 'stop'
|
||||
|
||||
|
||||
def start():
|
||||
file_tpl = getPluginDir() + '/conf/phpmyadmin.conf'
|
||||
file_conf = getConf()
|
||||
centent = public.readFile(file_tpl)
|
||||
centent = contentReplace(centent)
|
||||
public.writeFile(file_conf, centent)
|
||||
public.restartWeb()
|
||||
return 'ok'
|
||||
|
||||
|
||||
def stop():
|
||||
conf = getConf()
|
||||
if os.path.exists(conf):
|
||||
os.remove(conf)
|
||||
public.restartWeb()
|
||||
return 'ok'
|
||||
|
||||
|
||||
def restart():
|
||||
return start()
|
||||
|
||||
|
||||
def reload():
|
||||
return start()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
func = sys.argv[1]
|
||||
if func == 'status':
|
||||
print status()
|
||||
elif func == 'start':
|
||||
print start()
|
||||
elif func == 'stop':
|
||||
print stop()
|
||||
elif func == 'restart':
|
||||
print restart()
|
||||
elif func == 'reload':
|
||||
print reload()
|
||||
elif func == 'conf':
|
||||
print getConf()
|
||||
else:
|
||||
print 'error'
|
||||
Reference in New Issue
Block a user