28 lines
596 B
Django/Jinja
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) }};
|