- Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-php-pecl-install
executable file
·36 lines (30 loc) · 789 Bytes
/
docker-php-pecl-install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
set -e
usage() {
echo"usage: $0 [channel/]<package> ..."
echo" ie: $0 uploadprogress oauth-1.2.3"
}
if [ $#-eq 0 ];then
usage >&2
exit 1
fi
pecl install "$@"
while [ $#-gt 0 ];do
ext="$1"
ext=$(echo "$ext"| cut -d- -f1)
ext=$(echo "$ext"| cut -d\/ -f2)
shift
formodulein$(find /usr/local/lib/php/extensions -name "$ext.so");do
ini="/usr/local/etc/php/conf.d/docker-php-pecl-$ext.ini"
if grep -q zend_extension_entry "$module";then
# https://wiki.php.net/internals/extensions#loading_zend_extensions
line="zend_extension=$(readlink -f "$module")"
else
line="extension=$(basename "$module")"
fi
if! grep -q "$line""$ini"2>/dev/null;then
echo"$line">>"$ini"
fi
done
done
rm -rf /tmp/*