File tree Expand file tree Collapse file tree 3 files changed +42
-3
lines changed Expand file tree Collapse file tree 3 files changed +42
-3
lines changed Original file line number Diff line number Diff line change 17
17
{%- for version in pillar_php_version %}
18
18
{%- set first_version = pillar_php_version[0]|string %}
19
19
{%- set ini = php.lookup.cli.ini|replace(first_version, version) %}
20
+
21
+ {%- if version in php.cli.ini %}
22
+ {%- set settings_versioned = {} %}
23
+ {%- for key, value in settings.items() %}
24
+ {%- do settings_versioned.update({key: value.copy()}) %}
25
+ {%- endfor %}
26
+ {%- for key, value in php.cli.ini[version].items() %}
27
+ {%- if settings_versioned[key] is defined %}
28
+ {%- do settings_versioned[key].update(value) %}
29
+ {%- else %}
30
+ {%- do settings_versioned.update({key: value}) %}
31
+ {%- endif %}
32
+ {%- endfor %}
33
+ {%- endif %}
34
+
20
35
php_cli_ini_{{ version }}:
21
36
{{ php_ini(ini,
22
37
'php_cli_ini_ ' ~ version,
23
38
php.cli.ini.opts,
24
- settings
39
+ settings_versioned | default( settings)
25
40
) }}
26
41
{%- endfor %}
27
42
{%- else %}
Original file line number Diff line number Diff line change 21
21
{%- set conf = php.lookup.fpm.conf| replace(first_version, version) % }
22
22
{%- set pools = php.lookup.fpm.pools| replace(first_version, version) % }
23
23
24
+ {%- if version in php.fpm.config.ini % }
25
+ {%- set ini_settings_versioned = {} % }
26
+ {%- for key, value in ini_settings.items() % }
27
+ {%- do ini_settings_versioned.update({key: value.copy()}) % }
28
+ {%- endfor % }
29
+ {%- for key, value in php.fpm.config.ini[version].items() % }
30
+ {%- if ini_settings_versioned[key] is defined % }
31
+ {%- do ini_settings_versioned[key].update(value) % }
32
+ {%- else % }
33
+ {%- do ini_settings_versioned.update({key: value}) % }
34
+ {%- endif % }
35
+ {%- endfor % }
36
+ {%- endif % }
37
+
24
38
{%- for key, value in conf_settings.items() % }
25
39
{%- if value is string % }
26
40
{%- do conf_settings.update({key: value.replace(first_version, version)}) % }
27
41
{%- endif % }
28
42
{%- endfor % }
29
- {%- do conf_settings.global .update({' pid' : ' /var/ run/php' + version + ' -fpm.pid' }) % }
43
+ {%- do conf_settings.global .update({' pid' : ' /run/php /php' + version + ' -fpm.pid' }) % }
30
44
{%- do conf_settings.global .update({' error_log' : ' /var/log/php' + version + ' -fpm.log' }) % }
31
45
32
46
php_fpm_ini_config_{{ version }}:
33
47
{{ php_ini(ini,
34
48
' php_fpm_ini_config_' ~ version,
35
49
php.fpm.config.ini.opts,
36
- ini_settings
50
+ ini_settings_versioned | default( ini_settings)
37
51
) }}
38
52
39
53
php_fpm_conf_config_{{ version }}:
Original file line number Diff line number Diff line change @@ -102,6 +102,11 @@ php:
102
102
engine : ' Off'
103
103
extension_dir : ' /usr/lib/php/modules/'
104
104
extension : [pdo_mysql.so, iconv.so, openssl.so]
105
+ # if a list of versions is set in php:version, each version
106
+ # may have different settings
107
+ # '7.2':
108
+ # PHP:
109
+ # short_open_tag: 'On'
105
110
106
111
# options to manage the php-fpm conf file
107
112
conf :
@@ -169,6 +174,11 @@ php:
169
174
settings :
170
175
PHP :
171
176
engine : ' Off'
177
+ # if a list of versions is set in php:version, each version
178
+ # may have different settings
179
+ # '7.2':
180
+ # PHP:
181
+ # short_open_tag: 'On'
172
182
173
183
# php-xcache settings
174
184
xcache :
You can’t perform that action at this time.
0 commit comments