feat(php/ng): support for php cli multiversion
This commit is contained in:
parent
dbb542c4fb
commit
bb4a077d84
@ -11,5 +11,16 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
|
{% set pillar_php_ng_version = salt['pillar.get']('php:ng:version', '7.0') %}
|
||||||
|
{% if pillar_php_ng_version is iterable and pillar_php_ng_version is not string %}
|
||||||
|
{% for version in pillar_php_ng_version %}
|
||||||
|
{% set first_version = pillar_php_ng_version[0]|string %}
|
||||||
|
{% set ini = php.lookup.cli.ini|replace(first_version, version) %}
|
||||||
|
php_cli_ini_{{ version }}:
|
||||||
|
{{ php_ini(ini, php.cli.ini.opts, settings) }}
|
||||||
|
{% endfor %}
|
||||||
|
{% else %}
|
||||||
|
|
||||||
php_cli_ini:
|
php_cli_ini:
|
||||||
{{ php_ini(php.lookup.cli.ini, php.cli.ini.opts, settings) }}
|
{{ php_ini(php.lookup.cli.ini, php.cli.ini.opts, settings) }}
|
||||||
|
{% endif %}
|
||||||
|
@ -4,8 +4,19 @@ include:
|
|||||||
- php.ng.cli.install
|
- php.ng.cli.install
|
||||||
- php.ng.cli.ini
|
- php.ng.cli.ini
|
||||||
|
|
||||||
|
{% set pillar_php_ng_version = salt['pillar.get']('php:ng:version', '7.0') %}
|
||||||
|
{% if pillar_php_ng_version is iterable and pillar_php_ng_version is not string %}
|
||||||
|
extend:
|
||||||
|
{% for version in pillar_php_ng_version %}
|
||||||
|
php_cli_ini_{{ version }}:
|
||||||
|
file:
|
||||||
|
- require:
|
||||||
|
- sls: php.ng.cli.install
|
||||||
|
{% endfor %}
|
||||||
|
{% else %}
|
||||||
extend:
|
extend:
|
||||||
php_cli_ini:
|
php_cli_ini:
|
||||||
file:
|
file:
|
||||||
- require:
|
- require:
|
||||||
- sls: php.ng.cli.install
|
- sls: php.ng.cli.install
|
||||||
|
{% endif %}
|
||||||
|
@ -3,8 +3,18 @@
|
|||||||
|
|
||||||
{%- if salt['grains.get']('os_family') == "Debian" %}
|
{%- if salt['grains.get']('os_family') == "Debian" %}
|
||||||
{% set current_php = salt['alternatives.show_current']('php') %}
|
{% set current_php = salt['alternatives.show_current']('php') %}
|
||||||
|
{% set pillar_php_ng_version = salt['pillar.get']('php:ng:version', '7.0') %}
|
||||||
|
{% if pillar_php_ng_version is iterable and pillar_php_ng_version is not string %}
|
||||||
|
{% if 'alternatives_version' in salt['pillar.get']('php:ng') %}
|
||||||
|
{% set phpng_version = salt['pillar.get']('php:ng:alternatives_version') %}
|
||||||
|
{% else %}
|
||||||
|
{% set phpng_version = false %}
|
||||||
|
{% endif %}
|
||||||
|
{% else %}
|
||||||
{% set phpng_version = salt['pillar.get']('php:ng:version', '7.0')|string %}
|
{% set phpng_version = salt['pillar.get']('php:ng:version', '7.0')|string %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if phpng_version %}
|
||||||
php_{{ phpng_version }}_link:
|
php_{{ phpng_version }}_link:
|
||||||
alternatives.set:
|
alternatives.set:
|
||||||
- name: php
|
- name: php
|
||||||
@ -15,3 +25,4 @@ php_{{ phpng_version }}_link:
|
|||||||
- which php
|
- which php
|
||||||
- test {{ current_php }} != $(which php{{ phpng_version }})
|
- test {{ current_php }} != $(which php{{ phpng_version }})
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
Loading…
Reference in New Issue
Block a user