-
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathdocker-php-dev-mode
More file actions
executable file
·48 lines (42 loc) · 1.16 KB
/
docker-php-dev-mode
File metadata and controls
executable file
·48 lines (42 loc) · 1.16 KB
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
#!/bin/sh
set -e
usage() {
echo "usage: $0 COMMAND"
echo
echo "Turns PHP into development mode."
echo "There's not option to revert it since this should only be executed for dev images or runtime debugging."
echo
echo "Commands:"
echo " xdebug downloads, installs and enable xdebug in the container"
echo " config adds standard development configuration for PHP"
echo
}
case "$1" in
xdebug)
apkDel=
if [ -n "$PHPIZE_DEPS" ]; then
if apk info --installed .phpize-deps-configure > /dev/null; then
apkDel='.phpize-deps-configure'
elif ! apk info --installed .phpize-deps > /dev/null; then
# shellcheck disable=SC2086
apk add --no-cache --virtual .phpize-deps $PHPIZE_DEPS
apkDel='.phpize-deps'
fi
else
>&2 echo "\$PHPIZE_DEPS env variable is necessary to run this script"
exit 1
fi
apk add --no-cache linux-headers
pecl install xdebug-3.4.1
docker-php-ext-enable xdebug
apk del $apkDel
cp /usr/local/etc/php/conf.d/available/xdebug.ini /usr/local/etc/php/conf.d/zzz_xdebug.ini
;;
config)
cp /usr/local/etc/php/conf.d/available/dev.ini /usr/local/etc/php/conf.d/zzz_dev.ini
;;
*)
usage
exit 1
;;
esac