Skip to content

Commit

Permalink
Merge pull request #118 from Ocramius/fix/#116-align-phpdbg-to-cli-sa…
Browse files Browse the repository at this point in the history
…pi-settings

Fix #116: ensure `.ini` settings are reset for both `phpdbg` and `php-cli` SAPIs
  • Loading branch information
Ocramius authored Jul 25, 2022
2 parents 9774f48 + 573f026 commit 190e358
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions scripts/php_ini_dev_settings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ set -e

declare -a SUBSTITUTIONS

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

for PHP_VERSION in 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1;do
INI_FILE="/etc/php/${PHP_VERSION}/cli/php.ini"
for SUBSTITUTION in "${SUBSTITUTIONS[@]}";do
sed --in-place -E -e "${SUBSTITUTION}" "${INI_FILE}"
for PHP_SAPI in cli phpdbg; do
INI_FILE="/etc/php/${PHP_VERSION}/${PHP_SAPI}/php.ini"
for SUBSTITUTION in "${SUBSTITUTIONS[@]}";do
sed --in-place -E -e "${SUBSTITUTION}" "${INI_FILE}"
done
done
done

0 comments on commit 190e358

Please sign in to comment.