Add known non-default extension priorities in a config

This commit is contained in:
Shivam Mathur 2023-04-03 02:48:41 +05:30
parent 3d794ddd93
commit 36e33e130a
No known key found for this signature in database
GPG Key ID: 3E13E4C8591ACC2A
2 changed files with 33 additions and 1 deletions

27
src/configs/mod_priority Normal file
View File

@ -0,0 +1,27 @@
apc=25
apcu_bc=25
apcu-bc=25
blackfire=30
decimal=30
ds=30
grpc=30
http=25
pecl_http=25
pecl-http=25
inotify=30
libvirt-php=40
mailparse=25
maxminddb=30
memcached=25
mysqlnd=10
mysqlnd_ms=30
opcache=10
pdo=10
phalcon=35
protobuf=30
psr=15
rdkafka=30
swoole=25
vips=30
xml=15
zstd=30

View File

@ -50,7 +50,12 @@ enable_extension() {
enable_cache_extension_dependencies "$1" "$2" enable_cache_extension_dependencies "$1" "$2"
if ! [[ "${version:?}" =~ ${old_versions:?} ]] && command -v phpenmod >/dev/null 2>&1; then if ! [[ "${version:?}" =~ ${old_versions:?} ]] && command -v phpenmod >/dev/null 2>&1; then
mod="${ini_dir:?}"/../mods-available/"$1".ini mod="${ini_dir:?}"/../mods-available/"$1".ini
[ -e "$mod" ] || (echo "; priority=${3:'20'}"; echo "$2=${ext_dir:?}/$1.so") | sudo tee "$mod" >/dev/null if ! [ -e "$mod" ]; then
priority="${3:-20}";
mod_priority_line="$(grep -E "^$1=" "${src:?}/configs/mod_priority")";
[ -n "$mod_priority_line" ] && priority=$(echo "$mod_priority_line" | cut -d'=' -f 2)
(echo "; priority=$priority"; echo "$2=${ext_dir:?}/$1.so") | sudo tee "$mod" >/dev/null
fi
sudo phpenmod -v "$version" "$1" >/dev/null 2>&1 sudo phpenmod -v "$version" "$1" >/dev/null 2>&1
else else
echo "$2=${ext_dir:?}/$1.so" | sudo tee -a "${pecl_file:-${ini_file[@]}}" >/dev/null echo "$2=${ext_dir:?}/$1.so" | sudo tee -a "${pecl_file:-${ini_file[@]}}" >/dev/null