-
-
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
·42 lines (36 loc) · 988 Bytes
/
docker-php-dev-mode
File metadata and controls
executable file
·42 lines (36 loc) · 988 Bytes
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
#!/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)
if [ -n "$PHPIZE_DEPS" ]; then
# shellcheck disable=SC2086
yes | apt-get install $PHPIZE_DEPS
else
>&2 echo "\$PHPIZE_DEPS env variable is necessary to run this script"
exit 1
fi
yes | apt-get install "linux-headers-$ARCH"
pecl install xdebug-3.4.1
docker-php-ext-enable xdebug
yes | apt-get purge $PHPIZE_DEPS
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