Merge pull request #240 from midoks/dev

细节优化
pull/242/head
Mr Chen 3 years ago committed by GitHub
commit b17bfb0da6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      class/core/site_api.py
  2. 16
      plugins/php-apt/versions/phplib.conf
  3. 17
      plugins/php-yum/versions/phplib.conf
  4. 96
      plugins/php/versions/common/apcu.sh
  5. 16
      plugins/php/versions/phplib.conf
  6. 14
      plugins/phpmyadmin/index.py
  7. 8
      route/static/app/site.js

@ -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

@ -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",

@ -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": [

@ -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

@ -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": [

@ -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, '修改成功!')

@ -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');

Loading…
Cancel
Save