From b40cb7b4eaceb7b81983204ebb96a6dd9ed39ee2 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Fri, 8 Mar 2019 11:10:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/php/index.py | 5 +- plugins/php/js/php.js | 2 +- plugins/php/versions/53/apc.sh | 92 ++++++++++++++++++++++ plugins/php/versions/53/install.sh | 1 + plugins/php/versions/53/swoole.sh | 2 +- plugins/php/versions/53/zendguardloader.sh | 17 ++-- plugins/php/versions/{yaf.sh => demo.sh} | 2 + plugins/php/versions/phplib.conf | 15 ---- 8 files changed, 110 insertions(+), 26 deletions(-) create mode 100755 plugins/php/versions/53/apc.sh rename plugins/php/versions/{yaf.sh => demo.sh} (98%) diff --git a/plugins/php/index.py b/plugins/php/index.py index 8b24a3173..e313f39bf 100755 --- a/plugins/php/index.py +++ b/plugins/php/index.py @@ -570,11 +570,10 @@ def uninstallLib(version): name + '.sh' + ' uninstall ' + version data = public.execShell(execstr) - # print data - if data[0] == '': + if data[0] == '' and data[1] == '': return public.returnJson(True, '已经卸载成功!') else: - return public.returnJson(False, '卸载出现错误信息!:' + data[0]) + return public.returnJson(False, '卸载信息![通道0]:' + data[0] + "[通道0]:" + data[1]) if __name__ == "__main__": diff --git a/plugins/php/js/php.js b/plugins/php/js/php.js index f807ed980..6569d2505 100755 --- a/plugins/php/js/php.js +++ b/plugins/php/js/php.js @@ -529,7 +529,7 @@ function uninstallPHPLib(version, name, title, pathinfo) { showMsg(rdata.msg, function(){ getTaskCount(); phpLibConfig(version); - },{ icon: rdata.status ? 1 : 2 }); + },{ icon: rdata.status ? 1 : 2 },5000); }); }); diff --git a/plugins/php/versions/53/apc.sh b/plugins/php/versions/53/apc.sh new file mode 100755 index 000000000..85ede5b17 --- /dev/null +++ b/plugins/php/versions/53/apc.sh @@ -0,0 +1,92 @@ +#!/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=apc +LIBV=3.1.9 +sysName=`uname` +actionType=$1 +version=$2 +extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20090626/${LIBNAME}.so + +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_${version}_lib + mkdir -p $php_lib + + _LIBNAME=$(echo $LIBNAME | tr '[a-z]' '[A-Z]') + wget -O $php_lib/${LIBNAME}-${LIBV}.tgz http://pecl.php.net/get/${_LIBNAME}-${LIBV}.tgz + + cd $php_lib && tar xvf ${LIBNAME}-${LIBV}.tgz + cd ${LIBNAME}-${LIBV} + $serverPath/php/$version/bin/phpize + ./configure --with-php-config=$serverPath/php/$version/bin/php-config + make && make install + + cd $php_lib + + rm -rf ${_LIBNAME}-${LIBV} + rm -rf ${_LIBNAME}-${LIBV}.tgz + 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 + + $serverPath/php/init.d/php$version reload + 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 + $serverPath/php/init.d/php$version reload + 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/53/install.sh b/plugins/php/versions/53/install.sh index c41b63d83..817ee9599 100755 --- a/plugins/php/versions/53/install.sh +++ b/plugins/php/versions/53/install.sh @@ -60,6 +60,7 @@ cd $sourcePath/php/php-5.3.29 && ./configure \ --enable-mbstring \ --enable-sysvshm \ --enable-sysvmsg \ +--enable-exif \ --enable-ftp \ --enable-wddx \ --enable-soap \ diff --git a/plugins/php/versions/53/swoole.sh b/plugins/php/versions/53/swoole.sh index eebab3cf4..9ef76e4d2 100755 --- a/plugins/php/versions/53/swoole.sh +++ b/plugins/php/versions/53/swoole.sh @@ -84,7 +84,7 @@ Uninstall_lib() fi echo $serverPath/php/$version/etc/php.ini - sed -i '_bak' '/swoole.so/d' $serverPath/php/$version/etc/php.ini + sed -i '_bak' "/swoole.so/d" $serverPath/php/$version/etc/php.ini rm -f $extFile $serverPath/php/init.d/php$version reload diff --git a/plugins/php/versions/53/zendguardloader.sh b/plugins/php/versions/53/zendguardloader.sh index 1de5eaec7..9b8b111d7 100755 --- a/plugins/php/versions/53/zendguardloader.sh +++ b/plugins/php/versions/53/zendguardloader.sh @@ -36,10 +36,9 @@ Install_lib() if [ $sysName == 'Darwin' ]; then wget -O $php_lib/zend-loader-php5.3.tar.gz http://downloads.zend.com/guard/5.5.0/ZendGuardLoader-php-5.3-darwin-i386.tar.gz else - wget -O $php_lib/zend-loader-php5.3.tar.gz http://downloads.zend.com/guard/5.5.0/zend-loader-php5.6-linux-x86_64_update1.tar.gz + wget -O $php_lib/zend-loader-php5.3.tar.gz http://downloads.zend.com/guard/5.5.0/ZendGuardLoader-php-5.3-linux-glibc23-x86_64.tar.gz fi - cd $php_lib && tar xvf zend-loader-php5.3.tar.gz cd ZendGuardLoader-php* && cd php-5.3.x cp ZendGuardLoader.so $serverPath/php/$version/lib/php/extensions/no-debug-non-zts-20090626/ @@ -52,7 +51,13 @@ Install_lib() return fi - echo -e "[Zend ZendGuard Loader]\nzend_extension=ZendGuardLoader.so\nzend_loader.enable=1\nzend_loader.disable_licensing=0\nzend_loader.obfuscation_level_support=3\nzend_loader.license_path=" >> $serverPath/php/$version/etc/php.ini + echo "" >> $serverPath/php/$version/etc/php.ini + echo "[Zend ZendGuard Loader]" >> $serverPath/php/$version/etc/php.ini + echo "zend_extension=ZendGuardLoader.so" >> $serverPath/php/$version/etc/php.ini + echo "zend_loader.enable=1" >> $serverPath/php/$version/etc/php.ini + echo "zend_loader.disable_licensing=0" >> $serverPath/php/$version/etc/php.ini + echo "zend_loader.obfuscation_level_support=3" >> $serverPath/php/$version/etc/php.ini + echo "zend_loader.license_path=" >> $serverPath/php/$version/etc/php.ini $serverPath/php/init.d/php$version reload echo '===========================================================' @@ -72,9 +77,9 @@ Uninstall_lib() return fi - sed -i '_bak' '/ZendGuardLoader.so/d' $serverPath/php/$version/etc/php.ini - sed -i '_bak' '/zend_loader/d' $serverPath/php/$version/etc/php.ini - sed -i '_bak' '/\[Zend ZendGuard Loader\]/d' $serverPath/php/$version/etc/php.ini + sed -i '_bak' "/ZendGuardLoader.so/d" $serverPath/php/$version/etc/php.ini + sed -i '_bak' "/zend_loader/d" $serverPath/php/$version/etc/php.ini + sed -i '_bak' "/\[Zend ZendGuard Loader\]/d" $serverPath/php/$version/etc/php.ini rm -f $extFile $serverPath/php/init.d/php$version reload diff --git a/plugins/php/versions/yaf.sh b/plugins/php/versions/demo.sh similarity index 98% rename from plugins/php/versions/yaf.sh rename to plugins/php/versions/demo.sh index ea41a7625..ce0fc2842 100755 --- a/plugins/php/versions/yaf.sh +++ b/plugins/php/versions/demo.sh @@ -2,6 +2,8 @@ PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin export PATH +# /bin/bash apc.sh uninstall 53 + curPath=`pwd` rootPath=$(dirname "$curPath") diff --git a/plugins/php/versions/phplib.conf b/plugins/php/versions/phplib.conf index 1a25e723d..2988aac8a 100755 --- a/plugins/php/versions/phplib.conf +++ b/plugins/php/versions/phplib.conf @@ -147,21 +147,6 @@ "shell": "imap.sh", "check": "imap.so" }, - { - "name": "exif", - "versions": [ - "53", - "54", - "55", - "56", - "70", - "71" - ], - "type": "通用扩展", - "msg": "用于读取图片EXIF信息", - "shell": "exif.sh", - "check": "exif.so" - }, { "name": "intl", "versions": [