![]() |
|
Snippets |
|
Setting the datasource and adapter for the connection "$name" at runtime. Calling Propel::initialize() will load the necessary database adapters and clear any open connections.
<?php $dsn = Creole::parseDSN('mysql://localhost/symfony'); $c = Propel::getConfiguration(); $c['datasources'][$name]['connection'] = $dsn; $c['datasources'][$name]['adapter'] = $dsn['phptype']; Propel::setConfiguration($c); Propel::initialize();