Commit ea290cf 1 parent 45ce137 commit ea290cf Copy full SHA for ea290cf
File tree 4 files changed +55
-6
lines changed
4 files changed +55
-6
lines changed Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ S=$( bin/clinotty cat /usr/local/etc/php/php.ini | grep -iGc ' zlib.output_compression = 1' ) ;
4
+
5
+ spx_status () {
6
+ if [[ $S == 1 ]]; then
7
+ echo " Output compression is enabled, so you cannot currently debug with SPX."
8
+ else
9
+ echo " Output compression is disabled, so you can currently debug with SPX."
10
+ fi
11
+ }
12
+
13
+ spx_toggle () {
14
+ if [[ $S == 1 ]]; then
15
+ spx_enable
16
+ else
17
+ spx_disable
18
+ fi
19
+ }
20
+
21
+ spx_enable () {
22
+ if [[ $S == 1 ]]; then
23
+ bin/root sed -i -e ' s/^zlib.output_compression = 1/zlib.output_compression = 0/g' /usr/local/etc/php/php.ini
24
+ sleep 1
25
+ bin/restart phpfpm
26
+ echo " Output compression is now disabled, so you can start debugging with SPX."
27
+ else
28
+ echo " Output compression is already disabled, so you can start debugging with SPX."
29
+ fi
30
+ }
31
+
32
+ spx_disable () {
33
+ if [[ $S == 0 ]]; then
34
+ bin/root sed -i -e ' s/^zlib.output_compression = 0/zlib.output_compression = 1/g' /usr/local/etc/php/php.ini
35
+ sleep 1
36
+ bin/restart phpfpm
37
+ echo " Output compression is now enabled, so you can no longer debug with SPX."
38
+ else
39
+ echo " Output compression is already enabled, so you can no longer debug with SPX."
40
+ fi
41
+ }
42
+
43
+ firstArgLetter=" $( echo " $1 " | head -c 1) "
44
+
45
+ if [[ $firstArgLetter == " d" ]]; then
46
+ spx_disable
47
+ elif [[ $firstArgLetter == " e" ]]; then
48
+ spx_enable
49
+ elif [[ $firstArgLetter == " t" ]]; then
50
+ spx_toggle
51
+ elif [[ $firstArgLetter == " s" ]]; then
52
+ spx_status
53
+ else
54
+ printf " Please specify either 'disable', 'enable', 'status' or 'toggle' as an argument.\nEx: bin/spx status\n"
55
+ fi
Original file line number Diff line number Diff line change 1
- zlib.output_compression = 0
2
-
3
1
extension = /usr/lib/php-spx/modules/spx.so
4
2
spx.http_enabled = 1
5
3
spx.http_key = " dev"
Original file line number Diff line number Diff line change 1
- zlib.output_compression = 0
2
-
3
1
extension = /usr/lib/php-spx/modules/spx.so
4
2
spx.http_enabled = 1
5
3
spx.http_key = " dev"
Original file line number Diff line number Diff line change 1
- zlib.output_compression = 0
2
-
3
1
extension = /usr/lib/php-spx/modules/spx.so
4
2
spx.http_enabled = 1
5
3
spx.http_key = " dev"
You can’t perform that action at this time.
0 commit comments