-
Notifications
You must be signed in to change notification settings - Fork 3
/
xdebug
executable file
·59 lines (51 loc) · 853 Bytes
/
xdebug
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
52
53
54
55
56
57
58
59
#!/bin/bash
# Turn XDebug on and off for Apache and CLI.
XDEBUG_CLI=/etc/php/7.0/cli/conf.d/20-xdebug.ini
XDEBUG_FPM=/etc/php/7.0/fpm/conf.d/20-xdebug.ini
function on_cli {
if [ ! -f $XDEBUG_CLI ]; then
sudo ln -s /etc/php/mods-available/xdebug.ini $XDEBUG_CLI
fi
}
function on_fpm {
if [ ! -f $XDEBUG_FPM ]; then
sudo ln -s /etc/php/mods-available/xdebug.ini $XDEBUG_FPM
fi
}
function off_cli {
if [ -f $XDEBUG_CLI ]; then
sudo rm $XDEBUG_CLI
fi
}
function off_fpm {
if [ -f $XDEBUG_FPM ]; then
sudo rm $XDEBUG_FPM
fi
}
case "$1" in
on)
on_fpm
;;
off)
off_fpm
;;
on-all)
on_cli
on_fpm
;;
off-all)
off_cli
off_fpm
;;
*)
echo
php -v
exit 1
esac
echo
if [ ! $2 ]; then
sudo service apache2 restart
sudo service php7.0-fpm restart
echo
php -v
fi