Skip to content

Commit

Permalink
Add known non-default extension priorities in a config
Browse files Browse the repository at this point in the history
  • Loading branch information
shivammathur committed Apr 2, 2023
1 parent 3d794dd commit 36e33e1
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
27 changes: 27 additions & 0 deletions src/configs/mod_priority
Original file line number Diff line number Diff line change
@@ -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
7 changes: 6 additions & 1 deletion src/scripts/extensions/add_extensions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,12 @@ enable_extension() {
enable_cache_extension_dependencies "$1" "$2"
if ! [[ "${version:?}" =~ ${old_versions:?} ]] && command -v phpenmod >/dev/null 2>&1; then
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
else
echo "$2=${ext_dir:?}/$1.so" | sudo tee -a "${pecl_file:-${ini_file[@]}}" >/dev/null
Expand Down

0 comments on commit 36e33e1

Please sign in to comment.