-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtest.extensions.sh
executable file
·51 lines (42 loc) · 1.3 KB
/
test.extensions.sh
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
set -e
cd /root/installer/
function version_compare() {
dpkg --compare-versions "$@"
}
before="$(php -m)$(php -v)"
echo "Before: $before"
for extension in extensions/*.sh; do
echo -n "Installing ${extension}..."
extension_name="${extension%.sh}"
extension_name="${extension_name#extensions/}"
# NewRelic PHP agent is currently not supporting other architectures than x86_64 / amd64
if [ "$extension_name" = 'newrelic' ] && [ "$(uname -m)" != x86_64 ]; then
echo ' skipped'
continue
fi
if ! ./enable.sh "$extension_name" > /tmp/ext-install.log 2>&1; then
echo ' failure'
cat /tmp/ext-install.log
exit 1
fi
# These extensions aren't enabled by default
if [ "$extension_name" = 'blackfire' ] || [ "$extension_name" = "newrelic" ] || [ "$extension_name" = 'tideways' ]; then
echo ' success'
continue
fi
if [ "$extension_name" = "opcache" ]; then
extension_name='Zend OPcache'
fi
if php -m | grep -i -q "^$extension_name\$"; then
echo ' success'
continue
fi
echo ' failure'
echo "Could not find extension in php module list:"
php -m
exit 1
done
after="$(php -m)$(php -v)"
echo "After: $after\nDiff:"
diff -u <(echo "$before") <(echo "$after") || true