diff --git a/plugins/php/versions/80/mongodb.sh b/plugins/php/versions/80/yaf.sh similarity index 72% rename from plugins/php/versions/80/mongodb.sh rename to plugins/php/versions/80/yaf.sh index 664c1440f..43c9637f7 100755 --- a/plugins/php/versions/80/mongodb.sh +++ b/plugins/php/versions/80/yaf.sh @@ -11,13 +11,14 @@ rootPath=$(dirname "$rootPath") serverPath=$(dirname "$rootPath") sourcePath=${serverPath}/source/php -LIBNAME=mongodb -LIBV=1.7.5 -sysName=`uname` actionType=$1 version=$2 + +LIBNAME=yaf +LIBV=3.2.5 extFile=$serverPath/php/${version}/lib/php/extensions/no-debug-non-zts-20190128/${LIBNAME}.so +sysName=`uname` if [ "$sysName" == "Darwin" ];then BAK='_bak' else @@ -26,38 +27,38 @@ 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 + fi cd $php_lib/${LIBNAME}-${LIBV} - + $serverPath/php/$version/bin/phpize - ./configure --with-php-config=$serverPath/php/$version/bin/php-config \ - && make clean && make && make install && make clean - + ./configure --with-php-config=$serverPath/php/$version/bin/php-config + make && make install && make clean fi if [ ! -f "$extFile" ];then echo "ERROR!" - return + 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 "" >> $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 + $serverPath/php/init.d/php$version reload echo '===========================================================' echo 'successful!' @@ -67,18 +68,19 @@ Install_lib() Uninstall_lib() { if [ ! -f "$serverPath/php/$version/bin/php-config" ];then - echo "php$version 未安装,请选择其它版本!" + echo "php-$version 未安装,请选择其它版本!" return fi - + if [ ! -f "$extFile" ];then - echo "php$version 未安装${LIBNAME},请选择其它版本!" - echo "php-$vphp not install ${LIBNAME}, Plese select other version!" + 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}/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 $serverPath/php/init.d/php$version reload diff --git a/plugins/php/versions/phplib.conf b/plugins/php/versions/phplib.conf index dc616b332..f14daacba 100755 --- a/plugins/php/versions/phplib.conf +++ b/plugins/php/versions/phplib.conf @@ -219,7 +219,9 @@ "70", "71", "72", - "73" + "73", + "74", + "80" ], "type": "框架", "msg": "Yaf是一个C语言编写的PHP框架", @@ -264,8 +266,7 @@ "71", "72", "73", - "74", - "80" + "74" ], "type": "通用扩展", "msg": "Mongodb数据库连接驱动",