Skip to content

Commit 36e33e1

Browse files
committed
Add known non-default extension priorities in a config
1 parent 3d794dd commit 36e33e1

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

src/configs/mod_priority

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
apc=25
2+
apcu_bc=25
3+
apcu-bc=25
4+
blackfire=30
5+
decimal=30
6+
ds=30
7+
grpc=30
8+
http=25
9+
pecl_http=25
10+
pecl-http=25
11+
inotify=30
12+
libvirt-php=40
13+
mailparse=25
14+
maxminddb=30
15+
memcached=25
16+
mysqlnd=10
17+
mysqlnd_ms=30
18+
opcache=10
19+
pdo=10
20+
phalcon=35
21+
protobuf=30
22+
psr=15
23+
rdkafka=30
24+
swoole=25
25+
vips=30
26+
xml=15
27+
zstd=30

src/scripts/extensions/add_extensions.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,12 @@ enable_extension() {
5050
enable_cache_extension_dependencies "$1" "$2"
5151
if ! [[ "${version:?}" =~ ${old_versions:?} ]] && command -v phpenmod >/dev/null 2>&1; then
5252
mod="${ini_dir:?}"/../mods-available/"$1".ini
53-
[ -e "$mod" ] || (echo "; priority=${3:'20'}"; echo "$2=${ext_dir:?}/$1.so") | sudo tee "$mod" >/dev/null
53+
if ! [ -e "$mod" ]; then
54+
priority="${3:-20}";
55+
mod_priority_line="$(grep -E "^$1=" "${src:?}/configs/mod_priority")";
56+
[ -n "$mod_priority_line" ] && priority=$(echo "$mod_priority_line" | cut -d'=' -f 2)
57+
(echo "; priority=$priority"; echo "$2=${ext_dir:?}/$1.so") | sudo tee "$mod" >/dev/null
58+
fi
5459
sudo phpenmod -v "$version" "$1" >/dev/null 2>&1
5560
else
5661
echo "$2=${ext_dir:?}/$1.so" | sudo tee -a "${pecl_file:-${ini_file[@]}}" >/dev/null

0 commit comments

Comments
 (0)