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 1717 {%- for version in pillar_php_version %}
1818 {%- set first_version = pillar_php_version[0]|string %}
1919 {%- 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+
2035php_cli_ini_{{ version }}:
2136 {{ php_ini(ini,
2237 'php_cli_ini_ ' ~ version,
2338 php.cli.ini.opts,
24- settings
39+ settings_versioned | default( settings)
2540 ) }}
2641 {%- endfor %}
2742{%- else %}
Original file line number Diff line number Diff line change 2121 {%- set conf = php.lookup.fpm.conf| replace(first_version, version) % }
2222 {%- set pools = php.lookup.fpm.pools| replace(first_version, version) % }
2323
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+
2438 {%- for key, value in conf_settings.items() % }
2539 {%- if value is string % }
2640 {%- do conf_settings.update({key: value.replace(first_version, version)}) % }
2741 {%- endif % }
2842 {%- 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' }) % }
3044 {%- do conf_settings.global .update({' error_log' : ' /var/log/php' + version + ' -fpm.log' }) % }
3145
3246php_fpm_ini_config_{{ version }}:
3347 {{ php_ini(ini,
3448 ' php_fpm_ini_config_' ~ version,
3549 php.fpm.config.ini.opts,
36- ini_settings
50+ ini_settings_versioned | default( ini_settings)
3751 ) }}
3852
3953php_fpm_conf_config_{{ version }}:
Original file line number Diff line number Diff line change @@ -102,6 +102,11 @@ php:
102102 engine : ' Off'
103103 extension_dir : ' /usr/lib/php/modules/'
104104 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'
105110
106111 # options to manage the php-fpm conf file
107112 conf :
@@ -169,6 +174,11 @@ php:
169174 settings :
170175 PHP :
171176 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'
172182
173183 # php-xcache settings
174184 xcache :
You can’t perform that action at this time.
0 commit comments