File tree 14 files changed +169
-6
lines changed
14 files changed +169
-6
lines changed Original file line number Diff line number Diff line change @@ -116,6 +116,16 @@ RUN set -x \
116
116
${BUILD_DEPS} \
117
117
\
118
118
\
119
+ && EXTENSION_DIR="$( php -i | grep ^extension_dir | awk -F '=>' '{print $2}' | xargs )" \
120
+ && if [ ! -d "${EXTENSION_DIR}" ]; then mkdir -p "${EXTENSION_DIR}"; fi \
121
+ && curl https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz -L -o ioncube.tar.gz \
122
+ && tar xvfz ioncube.tar.gz \
123
+ && cd ioncube \
124
+ && cp "ioncube_loader_lin_5.3.so" "${EXTENSION_DIR}/ioncube.so" \
125
+ && cd ../ \
126
+ && rm -rf ioncube \
127
+ && rm -rf ioncube.tar.gz \
128
+ \
119
129
&& echo "/usr" | pecl install amqp \
120
130
&& docker-php-ext-enable amqp \
121
131
&& pecl install apcu-4.0.11 \
Original file line number Diff line number Diff line change @@ -116,6 +116,16 @@ RUN set -x \
116
116
${BUILD_DEPS} \
117
117
\
118
118
\
119
+ && EXTENSION_DIR="$( php -i | grep ^extension_dir | awk -F '=>' '{print $2}' | xargs )" \
120
+ && if [ ! -d "${EXTENSION_DIR}" ]; then mkdir -p "${EXTENSION_DIR}"; fi \
121
+ && curl https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz -L -o ioncube.tar.gz \
122
+ && tar xvfz ioncube.tar.gz \
123
+ && cd ioncube \
124
+ && cp "ioncube_loader_lin_5.4.so" "${EXTENSION_DIR}/ioncube.so" \
125
+ && cd ../ \
126
+ && rm -rf ioncube \
127
+ && rm -rf ioncube.tar.gz \
128
+ \
119
129
&& echo "/usr" | pecl install amqp \
120
130
&& docker-php-ext-enable amqp \
121
131
&& pecl install apcu-4.0.11 \
Original file line number Diff line number Diff line change @@ -118,6 +118,16 @@ RUN set -x \
118
118
${BUILD_DEPS} \
119
119
\
120
120
\
121
+ && EXTENSION_DIR="$( php -i | grep ^extension_dir | awk -F '=>' '{print $2}' | xargs )" \
122
+ && if [ ! -d "${EXTENSION_DIR}" ]; then mkdir -p "${EXTENSION_DIR}"; fi \
123
+ && curl https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz -L -o ioncube.tar.gz \
124
+ && tar xvfz ioncube.tar.gz \
125
+ && cd ioncube \
126
+ && cp "ioncube_loader_lin_5.5.so" "${EXTENSION_DIR}/ioncube.so" \
127
+ && cd ../ \
128
+ && rm -rf ioncube \
129
+ && rm -rf ioncube.tar.gz \
130
+ \
121
131
&& echo "/usr" | pecl install amqp \
122
132
&& docker-php-ext-enable amqp \
123
133
&& pecl install apcu-4.0.11 \
Original file line number Diff line number Diff line change @@ -120,6 +120,16 @@ RUN set -x \
120
120
${BUILD_DEPS} \
121
121
\
122
122
\
123
+ && EXTENSION_DIR="$( php -i | grep ^extension_dir | awk -F '=>' '{print $2}' | xargs )" \
124
+ && if [ ! -d "${EXTENSION_DIR}" ]; then mkdir -p "${EXTENSION_DIR}"; fi \
125
+ && curl https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz -L -o ioncube.tar.gz \
126
+ && tar xvfz ioncube.tar.gz \
127
+ && cd ioncube \
128
+ && cp "ioncube_loader_lin_5.6.so" "${EXTENSION_DIR}/ioncube.so" \
129
+ && cd ../ \
130
+ && rm -rf ioncube \
131
+ && rm -rf ioncube.tar.gz \
132
+ \
123
133
&& echo "/usr" | pecl install amqp \
124
134
&& docker-php-ext-enable amqp \
125
135
&& pecl install apcu-4.0.11 \
Original file line number Diff line number Diff line change @@ -118,6 +118,16 @@ RUN set -x \
118
118
${BUILD_DEPS} \
119
119
\
120
120
\
121
+ && EXTENSION_DIR="$( php -i | grep ^extension_dir | awk -F '=>' '{print $2}' | xargs )" \
122
+ && if [ ! -d "${EXTENSION_DIR}" ]; then mkdir -p "${EXTENSION_DIR}"; fi \
123
+ && curl https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz -L -o ioncube.tar.gz \
124
+ && tar xvfz ioncube.tar.gz \
125
+ && cd ioncube \
126
+ && cp "ioncube_loader_lin_7.0.so" "${EXTENSION_DIR}/ioncube.so" \
127
+ && cd ../ \
128
+ && rm -rf ioncube \
129
+ && rm -rf ioncube.tar.gz \
130
+ \
121
131
&& echo "/usr" | pecl install amqp \
122
132
&& docker-php-ext-enable amqp \
123
133
&& pecl install apcu \
Original file line number Diff line number Diff line change @@ -118,6 +118,16 @@ RUN set -x \
118
118
${BUILD_DEPS} \
119
119
\
120
120
\
121
+ && EXTENSION_DIR="$( php -i | grep ^extension_dir | awk -F '=>' '{print $2}' | xargs )" \
122
+ && if [ ! -d "${EXTENSION_DIR}" ]; then mkdir -p "${EXTENSION_DIR}"; fi \
123
+ && curl https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz -L -o ioncube.tar.gz \
124
+ && tar xvfz ioncube.tar.gz \
125
+ && cd ioncube \
126
+ && cp "ioncube_loader_lin_7.1.so" "${EXTENSION_DIR}/ioncube.so" \
127
+ && cd ../ \
128
+ && rm -rf ioncube \
129
+ && rm -rf ioncube.tar.gz \
130
+ \
121
131
&& echo "/usr" | pecl install amqp \
122
132
&& docker-php-ext-enable amqp \
123
133
&& pecl install apcu \
Original file line number Diff line number Diff line change @@ -119,6 +119,16 @@ RUN set -x \
119
119
${BUILD_DEPS} \
120
120
\
121
121
\
122
+ && EXTENSION_DIR="$( php -i | grep ^extension_dir | awk -F '=>' '{print $2}' | xargs )" \
123
+ && if [ ! -d "${EXTENSION_DIR}" ]; then mkdir -p "${EXTENSION_DIR}"; fi \
124
+ && curl https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz -L -o ioncube.tar.gz \
125
+ && tar xvfz ioncube.tar.gz \
126
+ && cd ioncube \
127
+ && cp "ioncube_loader_lin_7.2.so" "${EXTENSION_DIR}/ioncube.so" \
128
+ && cd ../ \
129
+ && rm -rf ioncube \
130
+ && rm -rf ioncube.tar.gz \
131
+ \
122
132
&& pecl install amqp \
123
133
&& docker-php-ext-enable amqp \
124
134
&& pecl install apcu \
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ set -e
4
+ set -u
5
+ set -o pipefail
6
+
7
+
8
+ # ###########################################################
9
+ # Functions
10
+ # ###########################################################
11
+
12
+ # ##
13
+ # ## Enable PHP Modules
14
+ # ##
15
+ enable_modules () {
16
+ local mod_varname=" ${1} "
17
+ local debug=" ${2} "
18
+ local cfg_path=" /usr/local/etc/php/conf.d"
19
+ local mod_path=
20
+ mod_path=" $( php -i | grep ^extension_dir | awk -F ' =>' ' {print $2}' | xargs ) "
21
+
22
+
23
+ if ! env_set " ${mod_varname} " ; then
24
+ log " info" " \$ ${mod_varname} not set. Not enabling any PHP modules." " ${debug} "
25
+ else
26
+ mods=" $( env_get " ${mod_varname} " ) "
27
+
28
+ if [ -z " ${mods} " ]; then
29
+ log " info" " \$ ${mod_varname} set, but empty. Not enabling any PHP modules." " ${debug} "
30
+ else
31
+ log " info" " Enabling the following PHP modules: ${mods} " " ${debug} "
32
+ fi
33
+
34
+ while read -r mod; do
35
+ mod=" $( echo " ${mod} " | xargs ) " # trim
36
+
37
+ # Does the module exist?
38
+ if [ -f " ${mod_path} /${mod} .so" ]; then
39
+ # Exceptions to load speficially
40
+ if [ " ${mod} " = " ioncube" ]; then
41
+ run " eche 'zend_extension=${mod_path} /ioncube.so' > '${cfg_path} /docker-ext-php-ext-ioncube.ini'" " ${debug} "
42
+ # Generic Load
43
+ else
44
+ run " docker-php-ext-enable ${mod} || true" " ${debug} "
45
+ fi
46
+ else
47
+ log " warn" " Enabling PHP Module: '${mod} ' does not exist" " ${debug} "
48
+ fi
49
+ done <<< " $( echo " ${mods} " | tr ',' '\n' )"
50
+ fi
51
+ }
Original file line number Diff line number Diff line change @@ -15,25 +15,24 @@ set -o pipefail
15
15
disable_modules () {
16
16
local mod_varname=" ${1} "
17
17
local debug=" ${2} "
18
- local mod_path =" /usr/local/etc/php/conf.d"
18
+ local cfg_path =" /usr/local/etc/php/conf.d"
19
19
20
20
if ! env_set " ${mod_varname} " ; then
21
21
log " info" " \$ ${mod_varname} not set. Not disabling any PHP modules." " ${debug} "
22
22
else
23
23
mods=" $( env_get " ${mod_varname} " ) "
24
24
25
25
if [ -z " ${mods} " ]; then
26
- log " warn " " \$ ${mod_varname} set, but empty. Not disabling any PHP modules." " ${debug} "
26
+ log " info " " \$ ${mod_varname} set, but empty. Not disabling any PHP modules." " ${debug} "
27
27
else
28
28
log " info" " Disabling the following PHP modules: ${mods} " " ${debug} "
29
29
fi
30
30
31
31
while read -r mod; do
32
- # for mod in ${mods//,/ }; do
33
32
mod=" $( echo " ${mod} " | xargs ) " # trim
34
33
35
34
# Find all config files that enable that module
36
- files=" $( grep -Er " ^(zend_)?extension.*(=|/)${mod} \.so" " ${mod_path } " || true ) "
35
+ files=" $( grep -Er " ^(zend_)?extension.*(=|/)${mod} \.so" " ${cfg_path } " || true ) "
37
36
38
37
if [ -n " ${files} " ]; then
39
38
while read -r f; do
@@ -44,6 +43,5 @@ disable_modules() {
44
43
done <<< " ${files}"
45
44
fi
46
45
done <<< " $( echo " ${mods} " | tr ',' '\n' )"
47
- # done
48
46
fi
49
47
}
Original file line number Diff line number Diff line change @@ -160,6 +160,12 @@ copy_ini_files "${PHP_CUST_INI_DIR}" "${PHP_INI_DIR}" "${DEBUG_LEVEL}"
160
160
copy_fpm_files " ${PHP_CUST_FPM_DIR} " " ${PHP_FPM_DIR} " " ${DEBUG_LEVEL} "
161
161
162
162
163
+ # ##
164
+ # ## Enable PHP Modules
165
+ # ##
166
+ enable_modules " ENABLE_MODULES" " ${DEBUG_LEVEL} "
167
+
168
+
163
169
# ##
164
170
# ## Disable PHP Modules
165
171
# ##
Original file line number Diff line number Diff line change @@ -160,6 +160,12 @@ copy_ini_files "${PHP_CUST_INI_DIR}" "${PHP_INI_DIR}" "${DEBUG_LEVEL}"
160
160
copy_fpm_files " ${PHP_CUST_FPM_DIR} " " ${PHP_FPM_DIR} " " ${DEBUG_LEVEL} "
161
161
162
162
163
+ # ##
164
+ # ## Enable PHP Modules
165
+ # ##
166
+ enable_modules " ENABLE_MODULES" " ${DEBUG_LEVEL} "
167
+
168
+
163
169
# ##
164
170
# ## Disable PHP Modules
165
171
# ##
Original file line number Diff line number Diff line change @@ -610,7 +610,7 @@ Have a look at the following table to see all supported environment variables fo
610
610
<td colspan =" 5 " ></td >
611
611
</tr >
612
612
<tr >
613
- <td rowspan =" 5 " ><strong >prod</strong ><br /><br /><strong >work</strong ></td >
613
+ <td rowspan =" 6 " ><strong >prod</strong ><br /><br /><strong >work</strong ></td >
614
614
<td ><code >TIMEZONE</code ></td >
615
615
<td >string</td >
616
616
<td ><code >UTC</code ></td >
@@ -622,6 +622,12 @@ Have a look at the following table to see all supported environment variables fo
622
622
<td ><code >1</code ></td >
623
623
<td >By default all Docker images are configured to output their PHP-FPM access and error logs to stdout and stderr. Those which support it can change the behaviour to log into files inside the container. Their respective directories are available as volumes that can be mounted to the host computer. This feature might help developer who are more comfortable with tailing or searching through actual files instead of using docker logs.<br /><br />Set this variable to <code >0</code > in order to enable logging to files. Log files are avilable under <code >/var/log/php/</code > which is also a docker volume that can be mounted locally.</td >
624
624
</tr >
625
+ <tr >
626
+ <td ><code >ENABLE_MODULES</code ></td >
627
+ <td >string</td >
628
+ <td ><code >''</code ></td >
629
+ <td >Comma separated list of PHP modules to enable, which are not enabled by default.<br /><strong >Example:</strong ><br /><code >ENABLE_MODULES=ioncube</code ></td >
630
+ </tr >
625
631
<tr >
626
632
<td ><code >DISABLE_MODULES</code ></td >
627
633
<td >string</td >
Original file line number Diff line number Diff line change @@ -113,6 +113,9 @@ RUN set -x \
113
113
{% endif %}
114
114
&& docker-php-ext-enable {{ ext }} \
115
115
&& cd / && rm -rf /tmp/{{ ext }} \
116
+ {# ---- 4.) CUSTOM ---- #}
117
+ {% elif extensions_available [ext ][php_version ]['type' ] == 'custom' %}
118
+ && {{ extensions_available[ext] [php_version] ['command'] }} \
116
119
{% endif %}
117
120
{# ---------- Installation (generic) ---------- #}
118
121
{% elif 'all' in extensions_available [ext ] and 'type' in extensions_available [ext ]['all' ] %}
@@ -147,6 +150,9 @@ RUN set -x \
147
150
{% endif %}
148
151
&& docker-php-ext-enable {{ ext }} \
149
152
&& cd / && rm -rf /tmp/{{ ext }} \
153
+ {# ---- 4.) CUSTOM ---- #}
154
+ {% elif extensions_available [ext ]['all' ]['type' ] == 'custom' %}
155
+ && {{ extensions_available[ext] ['all'] ['command'] }} \
150
156
{% endif %}
151
157
{% endif %}
152
158
{% endif %}
@@ -181,6 +187,8 @@ RUN set -x \
181
187
{% if ext == 'opcache' %}
182
188
&& php -m | grep -oiE '^Zend Opcache$' \
183
189
&& php-fpm -m | grep -oiE '^Zend Opcache$' \
190
+ {% elif ext == 'ioncube' %}
191
+ {# Not enabled #}
184
192
{% else %}
185
193
&& php -m | grep -oiE '^{{ ext }}$' \
186
194
&& php-fpm -m | grep -oiE '^{{ ext }}$' \
Original file line number Diff line number Diff line change @@ -398,6 +398,8 @@ software_available:
398
398
# ## Extensions to actually enable
399
399
# ##
400
400
extensions_enabled :
401
+ # ioncube must be loaded first
402
+ - ioncube
401
403
- amqp
402
404
- apcu
403
405
- bcmath
@@ -505,6 +507,8 @@ extensions_enabled:
505
507
# git_ref: [optional] Tag, branch, commit to checkout
506
508
# configure: [optional] Add './configure' arguments
507
509
# command: [optional] Overwrite default command (phpize && ./configure && make && make install)
510
+ # type: custom
511
+ # command: [required] Custom command to install and enable a module
508
512
extensions_available :
509
513
amqp :
510
514
disabled : [7.3]
@@ -663,6 +667,20 @@ extensions_available:
663
667
type : builtin
664
668
build_dep : [libicu-dev]
665
669
run_dep : [libicu52]
670
+ ioncube :
671
+ disabled : [7.3]
672
+ all :
673
+ type : custom
674
+ command : |
675
+ EXTENSION_DIR="$( php -i | grep ^extension_dir | awk -F '=>' '{print $2}' | xargs )" \
676
+ && if [ ! -d "${EXTENSION_DIR}" ]; then mkdir -p "${EXTENSION_DIR}"; fi \
677
+ && curl https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz -L -o ioncube.tar.gz \
678
+ && tar xvfz ioncube.tar.gz \
679
+ && cd ioncube \
680
+ && cp "ioncube_loader_lin_{{ php_version }}.so" "${EXTENSION_DIR}/ioncube.so" \
681
+ && cd ../ \
682
+ && rm -rf ioncube \
683
+ && rm -rf ioncube.tar.gz \
666
684
json :
667
685
7.0 :
668
686
type : builtin
You can’t perform that action at this time.
0 commit comments