zikula/core — pull request #1710 by cmfcmf (2014-05-31 14:09:42+00:00)
Title: Added a dynamic configuration dumper.

This is my idea for the dynamic (mailer) configuration problem, which I discussed with @craigh. You would execute the following code in the ModifyConfigHandler:
```php
$transport = \Zikula\Module\MailerModule\Api\AdminApi::$transportTypes[$vars['mailertype']];
$config = array(
'transport' => $transport,
'username' => $vars['smtpusername'],
'password' => $vars['smtppassword'],
'host' => $vars['smtpserver'],
'port' => $vars['smtpport'],
'encryption' => $vars['smtpsecuremethod'],
'auth_mode' => $vars['smtpauth'] ? 'login' : null,
'spool' => array('type' => 'memory'),
'delivery_address' => null,
'disable_delivery' => false,
);

$configDumper = $this->view->getContainer()->get('zikula.dynamic_config_dumper');
$configDumper->setConfiguartion('swiftmailer', $config);
```
would result in:
```yaml
#This is a dynamically generated configuration file. Do not touch!

swiftmailer:
transport: smtp
username: ...
password: ...
host: smtp.gmail.com
port: 465
encryption: ssl
auth_mode: login
spool: { type: memory }
delivery_address: null
disable_delivery: false
```