Skip to content

Commit 8a02537

Browse files
Merge pull request #43 from weierophinney/feature/dev-config
Use development php.ini settings
2 parents b483292 + abca2c7 commit 8a02537

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ RUN mkdir -p /usr/local/share/composer \
145145
&& ln -s /usr/local/share/composer/vendor/bin/cs2pr /usr/local/bin/cs2pr
146146

147147
COPY scripts /scripts
148+
RUN /scripts/php_ini_dev_settings.sh
148149
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
149150

150151
RUN useradd -ms /bin/bash testuser

scripts/php_ini_dev_settings.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
declare -a SUBSTITUTIONS
6+
7+
SUBSTITUTIONS+=('s/zend.exception_ignore_args ?= ?(On|Off)/zend.exception_ignore_args = Off/')
8+
SUBSTITUTIONS+=('s/zend.exception_string_param_max_len ?= ?[0-9]+/zend.exception_string_param_max_len = 15/')
9+
SUBSTITUTIONS+=('s/error_reporting ?= ?[A-Z_~ &]+/error_reporting = E_ALL/')
10+
SUBSTITUTIONS+=('s/display_errors ?= ?(On|Off)/display_errors = On/')
11+
SUBSTITUTIONS+=('s/display_startup_errors ?= ?(On|Off)/display_startup_errors = On/')
12+
SUBSTITUTIONS+=('s/mysqlnd.collect_memory_statistics ?= ?(On|Off)/mysqlnd.collect_memory_statistics = On/')
13+
SUBSTITUTIONS+=('s/zend.assertions ?= ?(-1|1)/zend.assertions = 1/')
14+
SUBSTITUTIONS+=('s/opcache.huge_code_pages ?= ?(0|1)/opcache.huge_code_pages = 0/')
15+
16+
for PHP_VERSION in 5.6 7.0 7.1 7.2 7.3 7.4 8.0;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}"
20+
done
21+
done

0 commit comments

Comments
 (0)