From f068bf1292fb34853b66a1fcc165e3e277d17c6c Mon Sep 17 00:00:00 2001 From: midoks Date: Wed, 2 Nov 2022 16:02:41 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E5=86=99=E8=AE=BF=E9=97=AE=E6=97=A5?= =?UTF-8?q?=E5=BF=97+=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- class/core/site_api.py | 2 +- route/static/app/site.js | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) 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/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'); From 7e627856d79e7f675a2f663e5120021d7371ce7a Mon Sep 17 00:00:00 2001 From: midoks Date: Wed, 2 Nov 2022 17:32:20 +0800 Subject: [PATCH 2/8] Update phplib.conf --- plugins/php-apt/versions/phplib.conf | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/php-apt/versions/phplib.conf b/plugins/php-apt/versions/phplib.conf index 518ef4d84..41577d074 100755 --- a/plugins/php-apt/versions/phplib.conf +++ b/plugins/php-apt/versions/phplib.conf @@ -280,7 +280,9 @@ "name": "apc", "versions": [ "53", - "54" + "54", + "55", + "56" ], "type": "缓存器", "msg": "脚本缓存器", From 93f79a7e69315abcc6a5e374181e1b9b607b8ac9 Mon Sep 17 00:00:00 2001 From: midoks Date: Wed, 2 Nov 2022 17:35:59 +0800 Subject: [PATCH 3/8] Update phplib.conf --- plugins/php-apt/versions/phplib.conf | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/plugins/php-apt/versions/phplib.conf b/plugins/php-apt/versions/phplib.conf index 41577d074..8c840ee24 100755 --- a/plugins/php-apt/versions/phplib.conf +++ b/plugins/php-apt/versions/phplib.conf @@ -279,10 +279,14 @@ { "name": "apc", "versions": [ - "53", - "54", - "55", - "56" + "56", + "70", + "71", + "72", + "73", + "74", + "80", + "81" ], "type": "缓存器", "msg": "脚本缓存器", From 929545562879a3f74868d90ca06bf08d096b2607 Mon Sep 17 00:00:00 2001 From: midoks Date: Wed, 2 Nov 2022 17:40:43 +0800 Subject: [PATCH 4/8] Update phplib.conf --- plugins/php-apt/versions/phplib.conf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/php-apt/versions/phplib.conf b/plugins/php-apt/versions/phplib.conf index 8c840ee24..37dd17de9 100755 --- a/plugins/php-apt/versions/phplib.conf +++ b/plugins/php-apt/versions/phplib.conf @@ -277,7 +277,7 @@ "check": "redis" }, { - "name": "apc", + "name": "apcu", "versions": [ "56", "70", @@ -290,8 +290,8 @@ ], "type": "缓存器", "msg": "脚本缓存器", - "shell": "apc.sh", - "check": "apc" + "shell": "apcu.sh", + "check": "apcu" }, { "name": "imagick", From 421c9a673cfeb10d30f359ac7a66f6a4e84a5e4f Mon Sep 17 00:00:00 2001 From: midoks Date: Wed, 2 Nov 2022 18:04:05 +0800 Subject: [PATCH 5/8] up --- plugins/php/versions/common/apcu.sh | 96 +++++++++++++++++++++++++++++ plugins/php/versions/phplib.conf | 16 +++++ 2 files changed, 112 insertions(+) create mode 100755 plugins/php/versions/common/apcu.sh diff --git a/plugins/php/versions/common/apcu.sh b/plugins/php/versions/common/apcu.sh new file mode 100755 index 000000000..4b62ce0b4 --- /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 @@ -353,6 +353,22 @@ "shell": "apc.sh", "check": "apc.so" }, + { + "name": "apcu", + "versions": [ + "70", + "71", + "72", + "73", + "74", + "80", + "81" + ], + "type": "缓存器", + "msg": "脚本缓存器", + "shell": "apcu.sh", + "check": "apcu" + }, { "name": "imagemagick", "versions": [ From fd23a4c572b7c17f95c2737a9969c829f8a0a395 Mon Sep 17 00:00:00 2001 From: midoks Date: Wed, 2 Nov 2022 18:22:21 +0800 Subject: [PATCH 6/8] =?UTF-8?q?phpmysqladmin=E4=BF=9D=E5=AD=98=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/phpmyadmin/index.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) 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, '修改成功!') From 00b978dd707882283cff3739d34bd5b7a9e2b6bd Mon Sep 17 00:00:00 2001 From: midoks Date: Wed, 2 Nov 2022 18:24:20 +0800 Subject: [PATCH 7/8] Update apcu.sh --- plugins/php/versions/common/apcu.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/php/versions/common/apcu.sh b/plugins/php/versions/common/apcu.sh index 4b62ce0b4..f756c5e0f 100755 --- a/plugins/php/versions/common/apcu.sh +++ b/plugins/php/versions/common/apcu.sh @@ -12,7 +12,7 @@ serverPath=$(dirname "$rootPath") sourcePath=${serverPath}/source/php LIBNAME=apcu -_LIBNAME=$(echo $LIBNAME | tr '[a-z]' '[A-Z]') +# _LIBNAME=$(echo $LIBNAME | tr '[a-z]' '[A-Z]') LIBV=5.1.22 sysName=`uname` actionType=$1 @@ -39,11 +39,11 @@ Install_lib() 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 + 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} + cd $php_lib/${LIBNAME}-${LIBV} $serverPath/php/$version/bin/phpize ./configure --with-php-config=$serverPath/php/$version/bin/php-config From 105f12cba67e4d34ed4f06bfb081b864b405adb3 Mon Sep 17 00:00:00 2001 From: midoks Date: Wed, 2 Nov 2022 18:32:09 +0800 Subject: [PATCH 8/8] Update phplib.conf --- plugins/php-yum/versions/phplib.conf | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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 @@ -92,6 +92,23 @@ "shell": "ioncube.sh", "check": "ioncube" }, + { + "name": "apcu", + "versions": [ + "56", + "70", + "71", + "72", + "73", + "74", + "80", + "81" + ], + "type": "缓存器", + "msg": "脚本缓存器", + "shell": "apcu.sh", + "check": "apcu" + }, { "name": "opcache", "versions": [