Skip to content

Commit d727b15

Browse files
alxwrmyii
authored andcommitted
feat(composer): make dependencies configurable
1 parent bf6a758 commit d727b15

File tree

3 files changed

+22
-8
lines changed

3 files changed

+22
-8
lines changed

php/composer.sls

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,9 @@
1212
1313
include:
1414
- php
15-
{% if grains['os_family'] == 'FreeBSD' %}
16-
- php.filter
17-
- php.hash
18-
- php.json
19-
- php.mbstring
20-
- php.openssl
21-
- php.phar
22-
{% endif %}
15+
{%- for module in php.lookup.get('composer', {}).get('required_modules', []) %}
16+
- php.{{ module }}
17+
{%- endfor %}
2318
2419
get-composer:
2520
file.managed:

php/map.jinja

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3102,6 +3102,15 @@
31023102
'cli': {
31033103
'ini': '/usr/local/etc/php.ini'
31043104
},
3105+
'composer': {
3106+
'required_modules': [
3107+
'filter',
3108+
'json',
3109+
'mbstring',
3110+
'openssl',
3111+
'phar',
3112+
],
3113+
},
31053114
'pkgs': {
31063115
'apache2': 'mod_php' + freebsd_php_version,
31073116
'composer_bin': 'composer',

pillar.example

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,16 @@ php:
7474
cli:
7575
ini: /location/of/php-cli/php.ini
7676

77+
# php.composer
78+
# Some OS need modules to be installed
79+
composer:
80+
required_modules:
81+
- filter
82+
- json
83+
- mbstring
84+
- openssl
85+
- phar
86+
7787
# php-fpm settings
7888
fpm:
7989

0 commit comments

Comments
 (0)