ansible-role-roundcube/templates/config.inc.php.j2
2025-01-17 13:15:09 +01:00

28 lines
596 B
Django/Jinja

<?php
/* {{ ansible_managed }} */
{% macro php_obj(obj) %}
{%- if obj is string -%}
'{{ obj|replace('\\', '\\\\')|replace('\'', '\\\'') }}'
{%- elif obj is number -%}
{{ obj }}
{%- elif obj is boolean -%}
{{ obj }}
{%- elif obj is none -%}
null
{% elif obj is mapping %}
[
{% for key, value in obj.items() %}
'{{ key|replace('\\', '\\\\')|replace('\'', '\\\'') }}' => {{ php_obj(value)|indent }},
{% endfor %}
]
{%- elif obj is iterable -%}
[
{% for item in obj %}
{{ php_obj(item)|indent(first=true) }},
{% endfor %}
]
{% endif %}
{% endmacro %}
$config = {{ php_obj(roundcube_config) }};