I use Zend Framework 1.10 with integration on Doctrine 1.2.
in the application.ini file, i declare the 'dsn' to connect to database.
in my application i need to connect to another db to run some queries.
how can i do it ?
i only need to run query , i don't want to generate all the Models for this DB.
right now in the bootstrap.php i do the default connection :
protected function _initDoctrine()
{
$this->getApplication()->getAutoloader()
->pushAutoloader(array('Doctrine', 'autoload'));
spl_autoload_register(array('Doctrine', 'modelsAutoload'));
$doctrineConfig = $this->getOption('doctrine');
$manager = Doctrine_Manager::getInstance();
$manager->setAttribute(Doctrine::ATTR_AUTO_ACCESSOR_OVERRIDE, true);
$manager->setAttribute(
Doctrine::ATTR_MODEL_LOADING,
$doctrineConfig['model_autoloading']
);
Doctrine_Core::loadModels($doctrineConfig['models_path']);
$conn = Doctrine_Manager::connection($doctrineConfig['dsn'],'doctrine');
$conn->setAttribute(Doctrine::ATTR_USE_NATIVE_ENUM, true);
Doctrine_Core::generateModelsFromDb('models', array('doctrine'), array('generateTableClasses' => true));
return $conn;
}