pull/632/head
Mr Chen 5 months ago
parent d217ebfc4f
commit a66bab02ab
  1. 89
      plugins/php-yum/versions/common/brotli.sh
  2. 40
      plugins/php-yum/versions/lib.sh
  3. 19
      plugins/php-yum/versions/phplib.conf

@ -0,0 +1,89 @@
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH=$PATH:/opt/homebrew/bin
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=brotli
LIBV=0.15.2
SORT_LIBNAME="10-${LIBNAME}"
extVer=`bash $curPath/lib.sh $version`
extFile=/opt/remi/php${version}/root/usr/lib64/php
extSoFile=$extFile/modules/${LIBNAME}.so
cfgDir=/etc/opt/remi/php${version}/php.d
extIni=${cfgDir}/10-${LIBNAME}.ini
if [ "$sysName" == "Darwin" ];then
BAK='_bak'
else
BAK=''
fi
Install_lib()
{
isInstall=`cat /etc/php/${version}/fpm/conf.d/* | grep -v '^;' |tr -s '\n' |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}
/opt/remi/php${version}/root/usr/bin/phpize
./configure --with-php-config=/usr/bin/php-config${version}
make && make install && make clean
fi
echo "$extFile checking ..."
if [ ! -f "$extFile" ];then
echo "ERROR!"
return;
fi
cho "" >> $extIni
echo "[${LIBNAME}]" >> $extIni
echo "extension=${LIBNAME}.so" >> $extIni
systemctl restart php${version}-fpm
echo '==========================================================='
echo 'successful!'
}
Uninstall_lib()
{
if [ -f $extIni ];then
rm -rf $extIni
fi
systemctl restart php${version}-fpm
echo '==============================================='
echo 'successful!'
}
if [ "$actionType" == 'install' ];then
Install_lib
elif [ "$actionType" == 'uninstall' ];then
Uninstall_lib
fi

@ -22,8 +22,38 @@ if [ "$php_status" != "" ];then
systemctl ${action} php${version}-php-fpm
fi
# if [ -f $php_fpm_service_file ];then
# systemctl ${action} php${version}-php-fpm
# else
# $serverPath/php/init.d/php${version} ${action}
# fi
#!/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")
serverPath=$(dirname "$rootPath")
version=$1
if [ "$version" == '5.6' ];then
echo '20131226'
elif [[ "$version" == '7.0' ]]; then
echo '20151012'
elif [[ "$version" == '7.1' ]]; then
echo '20160303'
elif [[ "$version" == '7.2' ]]; then
echo '20170718'
elif [[ "$version" == '7.3' ]]; then
echo '20180731'
elif [[ "$version" == '7.4' ]]; then
echo '20190902'
elif [[ "$version" == '8.0' ]]; then
echo '20200930'
elif [[ "$version" == '8.1' ]]; then
echo '20210902'
elif [[ "$version" == '8.2' ]]; then
echo '20220829'
elif [[ "$version" == '8.3' ]]; then
echo '20230831'
elif [[ "$version" == '8.4' ]]; then
echo '20240924'
fi

@ -183,6 +183,25 @@
"shell": "mcrypt.sh",
"check": "mcrypt"
},
{
"name": "brotli",
"versions": [
"70",
"71",
"72",
"73",
"74",
"80",
"81",
"82",
"83",
"84"
],
"type": "压缩",
"msg": "压缩算法",
"shell": "brotli.sh",
"check": "brotli.so"
},
{
"name": "bcmath",
"versions": [

Loading…
Cancel
Save