From 22c3c6ee9aa61fd7ca233fed9017d6908c811128 Mon Sep 17 00:00:00 2001 From: midoks Date: Sat, 9 Jul 2022 18:03:38 +0800 Subject: [PATCH] up --- plugins/php-apt/versions/common/yaf.sh | 98 +++++++++++++++++++++- plugins/php/versions/53/yar.sh | 107 ------------------------ plugins/php/versions/54/swoole.sh | 3 - plugins/php/versions/54/yar.sh | 109 ------------------------ plugins/php/versions/55/yar.sh | 110 ------------------------- plugins/php/versions/56/swoole.sh | 5 +- plugins/php/versions/56/yaf.sh | 6 +- plugins/php/versions/56/yar.sh | 107 ------------------------ plugins/php/versions/common/yar.sh | 4 + 9 files changed, 106 insertions(+), 443 deletions(-) mode change 100644 => 100755 plugins/php-apt/versions/common/yaf.sh delete mode 100755 plugins/php/versions/53/yar.sh delete mode 100755 plugins/php/versions/54/yar.sh delete mode 100755 plugins/php/versions/55/yar.sh delete mode 100755 plugins/php/versions/56/yar.sh diff --git a/plugins/php-apt/versions/common/yaf.sh b/plugins/php-apt/versions/common/yaf.sh old mode 100644 new mode 100755 index 488eb9cad..cba84c5f2 --- a/plugins/php-apt/versions/common/yaf.sh +++ b/plugins/php-apt/versions/common/yaf.sh @@ -1,6 +1,102 @@ #!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin +export PATH -action=$1 +curPath=`pwd` + +rootPath=$(dirname "$curPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +serverPath=$(dirname "$rootPath") +sourcePath=${serverPath}/source/php + + +actionType=$1 version=$2 +sysName=`uname` +LIBNAME=yaf +LIBV=3.3.5 + + + +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 + echo "${LIBNAME}.use_namespace=1" >> $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 + + if [ ! -f "$extFile" ];then + echo "php-$version 未安装${LIBNAME},请选择其它版本!" + return + fi + + echo $serverPath/php/$version/etc/php.ini + sed -i $BAK "/${LIBNAME}.so/d" $serverPath/php/$version/etc/php.ini + sed -i $BAK "/${LIBNAME}.use_namespace/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/53/yar.sh b/plugins/php/versions/53/yar.sh deleted file mode 100755 index 505954e24..000000000 --- a/plugins/php/versions/53/yar.sh +++ /dev/null @@ -1,107 +0,0 @@ -#!/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=yar -LIBV=1.2.5 - -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 [ "$version" = '70' ] || [ "$version" = '71' ] || [ "$version" = '72' ] || [ "$version" = '73' ];then - LIBV='2.0.5' -fi - -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 \ - --with-curl=$serverPath/lib/curl - 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 - echo "${LIBNAME}.expose_info=false" >> $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 - - if [ ! -f "$extFile" ];then - echo "php-$version 未安装${LIBNAME},请选择其它版本!" - echo "php-$version not install ${LIBNAME}, Plese select other version!" - return - fi - - echo $serverPath/php/$version/etc/php.ini - sed -i $BAK "/${LIBNAME}.so/d" $serverPath/php/$version/etc/php.ini - sed -i $BAK "/${LIBNAME}.use_namespace/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/54/swoole.sh b/plugins/php/versions/54/swoole.sh index f0af7ff2f..ebaddbb5d 100755 --- a/plugins/php/versions/54/swoole.sh +++ b/plugins/php/versions/54/swoole.sh @@ -16,9 +16,6 @@ version=$2 LIBNAME=swoole LIBV='1.10.1' -if [ "$version" = '70' ] || [ "$version" = '71' ] || [ "$version" = '72' ];then - LIBV='2.2.0' -fi 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 diff --git a/plugins/php/versions/54/yar.sh b/plugins/php/versions/54/yar.sh deleted file mode 100755 index a8be8e9f6..000000000 --- a/plugins/php/versions/54/yar.sh +++ /dev/null @@ -1,109 +0,0 @@ -#!/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=yar -LIBV=1.2.5 - -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 [ "$version" = '70' ] || [ "$version" = '71' ] || [ "$version" = '72' ] || [ "$version" = '73' ];then - LIBV='2.0.5' -fi - -sysName=`uname` -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 - 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 - echo "./configure --with-php-config=$serverPath/php/$version/bin/php-config \ - --with-curl=$serverPath/php/curl" - ./configure --with-php-config=$serverPath/php/$version/bin/php-config \ - --with-curl=$serverPath/lib/curl - 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 - echo "${LIBNAME}.expose_info=false" >> $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 - - if [ ! -f "$extFile" ];then - echo "php-$version 未安装${LIBNAME},请选择其它版本!" - echo "php-$version not install ${LIBNAME}, Plese select other version!" - return - fi - - echo $serverPath/php/$version/etc/php.ini - sed -i '_bak' "/${LIBNAME}.so/d" $serverPath/php/$version/etc/php.ini - sed -i '_bak' "/${LIBNAME}.use_namespace/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/55/yar.sh b/plugins/php/versions/55/yar.sh deleted file mode 100755 index 620c105b4..000000000 --- a/plugins/php/versions/55/yar.sh +++ /dev/null @@ -1,110 +0,0 @@ -#!/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=yar -LIBV=1.2.5 - -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 [ "$version" = '70' ] || [ "$version" = '71' ] || [ "$version" = '72' ] || [ "$version" = '73' ];then - LIBV='2.0.5' -fi - -sysName=`uname` -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 - 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 - echo "./configure --with-php-config=$serverPath/php/$version/bin/php-config \ - --with-curl=$serverPath/php/curl" - ./configure --with-php-config=$serverPath/php/$version/bin/php-config \ - --with-curl=$serverPath/lib/curl - 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 - echo "${LIBNAME}.expose_info=false" >> $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 - - if [ ! -f "$extFile" ];then - echo "php-$version 未安装${LIBNAME},请选择其它版本!" - echo "php-$version not install ${LIBNAME}, Plese select other version!" - return - fi - - echo $serverPath/php/$version/etc/php.ini - sed -i $BAK "/${LIBNAME}.so/d" $serverPath/php/$version/etc/php.ini - sed -i $BAK "/${LIBNAME}.use_namespace/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/56/swoole.sh b/plugins/php/versions/56/swoole.sh index cb3907c1d..a763b9dbb 100755 --- a/plugins/php/versions/56/swoole.sh +++ b/plugins/php/versions/56/swoole.sh @@ -16,10 +16,7 @@ version=$2 LIBNAME=swoole -LIBV='1.10.1'; -if [ "$version" = '70' ] || [ "$version" = '71' ] || [ "$version" = '72' ];then - LIBV='2.2.0' -fi +LIBV=1.10.1 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 diff --git a/plugins/php/versions/56/yaf.sh b/plugins/php/versions/56/yaf.sh index 87f953439..ac58a4cbd 100755 --- a/plugins/php/versions/56/yaf.sh +++ b/plugins/php/versions/56/yaf.sh @@ -11,6 +11,9 @@ rootPath=$(dirname "$rootPath") serverPath=$(dirname "$rootPath") sourcePath=${serverPath}/source/php +actionType=$1 +version=$2 + LIBNAME=yaf LIBV=2.3.5 @@ -87,8 +90,7 @@ Uninstall_lib() } -actionType=$1 -version=$2 + if [ "$actionType" == 'install' ];then Install_lib elif [ "$actionType" == 'uninstall' ];then diff --git a/plugins/php/versions/56/yar.sh b/plugins/php/versions/56/yar.sh deleted file mode 100755 index 202208c33..000000000 --- a/plugins/php/versions/56/yar.sh +++ /dev/null @@ -1,107 +0,0 @@ -#!/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=yar -LIBV=1.2.5 - -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 [ "$version" = '70' ] || [ "$version" = '71' ] || [ "$version" = '72' ] || [ "$version" = '73' ];then - LIBV='2.0.5' -fi - -sysName=`uname` -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 \ - --with-curl=$serverPath/lib/curl - 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 - echo "${LIBNAME}.expose_info=false" >> $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 - - if [ ! -f "$extFile" ];then - echo "php-$version 未安装${LIBNAME},请选择其它版本!" - echo "php-$version not install ${LIBNAME}, Plese select other version!" - return - fi - - echo $serverPath/php/$version/etc/php.ini - sed -i $BAK "/${LIBNAME}.so/d" $serverPath/php/$version/etc/php.ini - sed -i $BAK "/${LIBNAME}.use_namespace/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/common/yar.sh b/plugins/php/versions/common/yar.sh index 11b4ad038..961ac0fd5 100755 --- a/plugins/php/versions/common/yar.sh +++ b/plugins/php/versions/common/yar.sh @@ -17,6 +17,10 @@ version=$2 LIBNAME=yar LIBV=2.3.2 +if [ "$version" -lt "70" ];then + LIBV=1.2.5 +fi + 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