Skip to content

Commit 190e358

Browse files
authored
Merge pull request #118 from Ocramius/fix/#116-align-phpdbg-to-cli-sapi-settings
Fix #116: ensure `.ini` settings are reset for both `phpdbg` and `php-cli` SAPIs
2 parents 9774f48 + 573f026 commit 190e358

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

scripts/php_ini_dev_settings.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ set -e
44

55
declare -a SUBSTITUTIONS
66

7+
SUBSTITUTIONS+=('s/memory_limit ?= ?(.*)/memory_limit = -1/')
78
SUBSTITUTIONS+=('s/zend.exception_ignore_args ?= ?(On|Off)/zend.exception_ignore_args = Off/')
89
SUBSTITUTIONS+=('s/zend.exception_string_param_max_len ?= ?[0-9]+/zend.exception_string_param_max_len = 15/')
910
SUBSTITUTIONS+=('s/error_reporting ?= ?[A-Z_~ &]+/error_reporting = E_ALL/')
@@ -14,8 +15,10 @@ SUBSTITUTIONS+=('s/zend.assertions ?= ?(-1|1)/zend.assertions = 1/')
1415
SUBSTITUTIONS+=('s/opcache.huge_code_pages ?= ?(0|1)/opcache.huge_code_pages = 0/')
1516

1617
for PHP_VERSION in 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1;do
17-
INI_FILE="/etc/php/${PHP_VERSION}/cli/php.ini"
18-
for SUBSTITUTION in "${SUBSTITUTIONS[@]}";do
19-
sed --in-place -E -e "${SUBSTITUTION}" "${INI_FILE}"
18+
for PHP_SAPI in cli phpdbg; do
19+
INI_FILE="/etc/php/${PHP_VERSION}/${PHP_SAPI}/php.ini"
20+
for SUBSTITUTION in "${SUBSTITUTIONS[@]}";do
21+
sed --in-place -E -e "${SUBSTITUTION}" "${INI_FILE}"
22+
done
2023
done
2124
done

0 commit comments

Comments
 (0)