diff --git a/class/core/site_api.py b/class/core/site_api.py index 11570ae2d..07a25e781 100755 --- a/class/core/site_api.py +++ b/class/core/site_api.py @@ -1883,7 +1883,7 @@ location ^~ {from} { conf = mw.readFile(filename) if conf.find('#ErrorLog') != -1: return False - if conf.find("access_log /dev/null") != -1: + if conf.find("access_log off") != -1: return False return True diff --git a/plugins/php-apt/versions/phplib.conf b/plugins/php-apt/versions/phplib.conf index 518ef4d84..37dd17de9 100755 --- a/plugins/php-apt/versions/phplib.conf +++ b/plugins/php-apt/versions/phplib.conf @@ -277,15 +277,21 @@ "check": "redis" }, { - "name": "apc", + "name": "apcu", "versions": [ - "53", - "54" + "56", + "70", + "71", + "72", + "73", + "74", + "80", + "81" ], "type": "缓存器", "msg": "脚本缓存器", - "shell": "apc.sh", - "check": "apc" + "shell": "apcu.sh", + "check": "apcu" }, { "name": "imagick", diff --git a/plugins/php-yum/versions/phplib.conf b/plugins/php-yum/versions/phplib.conf index ce1b02b32..2b0f72c78 100755 --- a/plugins/php-yum/versions/phplib.conf +++ b/plugins/php-yum/versions/phplib.conf @@ -93,6 +93,23 @@ "check": "ioncube" }, { + "name": "apcu", + "versions": [ + "56", + "70", + "71", + "72", + "73", + "74", + "80", + "81" + ], + "type": "缓存器", + "msg": "脚本缓存器", + "shell": "apcu.sh", + "check": "apcu" + }, + { "name": "opcache", "versions": [ "74", diff --git a/plugins/php/versions/common/apcu.sh b/plugins/php/versions/common/apcu.sh new file mode 100755 index 000000000..f756c5e0f --- /dev/null +++ b/plugins/php/versions/common/apcu.sh @@ -0,0 +1,96 @@ +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin +export PATH + +curPath=`pwd` + +rootPath=$(dirname "$curPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +serverPath=$(dirname "$rootPath") +sourcePath=${serverPath}/source/php + +LIBNAME=apcu +# _LIBNAME=$(echo $LIBNAME | tr '[a-z]' '[A-Z]') +LIBV=5.1.22 +sysName=`uname` +actionType=$1 +version=$2 + +NON_ZTS_FILENAME=`ls $serverPath/php/${version}/lib/php/extensions | grep no-debug-non-zts` +extFile=$serverPath/php/${version}/lib/php/extensions/${NON_ZTS_FILENAME}/${LIBNAME}.so + +if [ "$sysName" == "Darwin" ];then + BAK='_bak' +else + BAK='' +fi + +Install_lib() +{ + isInstall=`cat $serverPath/php/$version/etc/php.ini|grep "${LIBNAME}.so"` + if [ "${isInstall}" != "" ];then + echo "php-$version 已安装${LIBNAME},请选择其它版本!" + return + fi + + if [ ! -f "$extFile" ];then + + php_lib=$sourcePath/php_lib + mkdir -p $php_lib + if [ ! -d $php_lib/${LIBNAME}-${LIBV} ];then + wget -O $php_lib/${LIBNAME}-${LIBV}.tgz http://pecl.php.net/get/${LIBNAME}-${LIBV}.tgz + cd $php_lib && tar xvf ${LIBNAME}-${LIBV}.tgz + fi + cd $php_lib/${LIBNAME}-${LIBV} + + $serverPath/php/$version/bin/phpize + ./configure --with-php-config=$serverPath/php/$version/bin/php-config + make && make install && make clean + fi + + if [ ! -f "$extFile" ];then + echo "ERROR!" + return + fi + + echo "" >> $serverPath/php/$version/etc/php.ini + echo "[${LIBNAME}]" >> $serverPath/php/$version/etc/php.ini + echo "extension=${LIBNAME}.so" >> $serverPath/php/$version/etc/php.ini + + bash ${rootPath}/plugins/php/versions/lib.sh $version restart + echo '===========================================================' + echo 'successful!' +} + + +Uninstall_lib() +{ + if [ ! -f "$serverPath/php/$version/bin/php-config" ];then + echo "php-$version 未安装,请选择其它版本!" + return + fi + + echo $extFile + if [ ! -f "$extFile" ];then + echo "php-$version 未安装${LIBNAME},请选择其它版本!" + echo "php-$version not install ${LIBNAME}, Plese select other version!" + return + fi + + sed -i $BAK "/${LIBNAME}.so/d" $serverPath/php/$version/etc/php.ini + sed -i $BAK "/${LIBNAME}/d" $serverPath/php/$version/etc/php.ini + + rm -f $extFile + bash ${rootPath}/plugins/php/versions/lib.sh $version restart + echo '===============================================' + echo 'successful!' +} + + +if [ "$actionType" == 'install' ];then + Install_lib +elif [ "$actionType" == 'uninstall' ];then + Uninstall_lib +fi \ No newline at end of file diff --git a/plugins/php/versions/phplib.conf b/plugins/php/versions/phplib.conf index 2e4d3b4ce..d3ece9582 100755 --- a/plugins/php/versions/phplib.conf +++ b/plugins/php/versions/phplib.conf @@ -354,6 +354,22 @@ "check": "apc.so" }, { + "name": "apcu", + "versions": [ + "70", + "71", + "72", + "73", + "74", + "80", + "81" + ], + "type": "缓存器", + "msg": "脚本缓存器", + "shell": "apcu.sh", + "check": "apcu" + }, + { "name": "imagemagick", "versions": [ "54", diff --git a/plugins/phpmyadmin/index.py b/plugins/phpmyadmin/index.py index 5b11ad07d..e843b7dcb 100755 --- a/plugins/phpmyadmin/index.py +++ b/plugins/phpmyadmin/index.py @@ -124,7 +124,8 @@ def contentReplace(content): content = content.replace('{$BLOWFISH_SECRET}', blowfish_secret) cfg = getCfg() - if (cfg['choose'] == ""): + + if (cfg['choose'] == "mysql"): content = content.replace('{$CHOOSE_DB}', 'mysql') content = content.replace('{$CHOOSE_DB_DIR}', 'mysql') else: @@ -136,7 +137,6 @@ def contentReplace(content): port = cfg["port"] rep = 'listen\s*(.*);' content = re.sub(rep, "listen " + port + ';', content) - return content @@ -327,11 +327,13 @@ def setPmaChoose(): choose = args['choose'] setCfg('choose', choose) - conf_run = getServerDir() + '/phpmyadmin/config.inc.php' + pma_path = getCfg()['path'] + conf_run = getServerDir() + "/" + pma_path + '/config.inc.php' + conf_tpl = getPluginDir() + '/conf/config.inc.php' - centent = mw.readFile(conf_tpl) - centent = contentReplace(centent) - mw.writeFile(conf_run, centent) + content = mw.readFile(conf_tpl) + content = contentReplace(content) + mw.writeFile(conf_run, content) mw.restartWeb() return mw.returnJson(True, '修改成功!') diff --git a/route/static/app/site.js b/route/static/app/site.js index d291d891f..ff72dd34d 100755 --- a/route/static/app/site.js +++ b/route/static/app/site.js @@ -396,9 +396,11 @@ function webPathEdit(id){ }); $("#logs").change(function(){ - $.post('/site/logs_open','id='+id,function(userini){ - layer.msg(userini.msg,{icon:userini.status?1:2}); - },'josn'); + var loadT = layer.msg("正在设置中...",{icon:16,time:10000,shade: [0.3, '#000']}); + $.post('/site/logs_open','id='+id, function(rdata){ + layer.close(loadT); + layer.msg(rdata.msg,{icon:rdata.status?1:2}); + },'json'); }); },'json');