Example #1
0
 public function init()
 {
     $return = parent::init();
     foreach ($this->_dbs as $databaseName => $database) {
         Zend_Registry::set($databaseName, $database);
     }
     return $return;
 }
Example #2
0
 /**
  * @group ZF-10049
  */
 public function testSetDefaultMetadataCacheFromCacheManager()
 {
     $configCache = array('database' => array('frontend' => array('name' => 'Core', 'options' => array('lifetime' => 120, 'automatic_serialization' => true)), 'backend' => array('name' => 'Black Hole')));
     $this->bootstrap->registerPluginResource('cachemanager', $configCache);
     $options = $this->_dbOptions;
     $options['defaultMetadataCache'] = 'database';
     $resource = new Zend_Application_Resource_Multidb($options);
     $resource->setBootstrap($this->bootstrap);
     $resource->init();
     $this->assertType('Zend_Cache_Core', Zend_Db_Table::getDefaultMetadataCache());
 }
Example #3
0
 /**
  * @group ZF-9131
  */
 public function testParamDefaultAndAdapterAreNotPassedOnAsParameter()
 {
     $resource = new Zend_Application_Resource_Multidb(array());
     $resource->setBootstrap($this->bootstrap);
     $options = $this->_dbOptions;
     $options['db2']['isDefaultTableAdapter'] = true;
     $resource->setOptions($options);
     $res = $resource->init();
     $expected = array('dbname' => 'db2', 'password' => 'notthatpublic', 'username' => 'dba', 'charset' => null, 'persistent' => false, 'options' => array('caseFolding' => 0, 'autoQuoteIdentifiers' => true), 'driver_options' => array());
     $this->assertEquals($expected, $res->getDb('db2')->getConfig());
     $options = $this->_dbOptions;
     $options['db2']['default'] = true;
     $resource->setOptions($options);
     $res = $resource->init();
     $this->assertEquals($expected, $res->getDb('db2')->getConfig());
 }
Example #4
0
 public function init()
 {
     parent::init();
     $this->_saveInRegistry()->_saveConfigRegistry()->_registerSqliteFunctions();
     return $this;
 }
Example #5
0
 /**
  * Get dao
  *
  * @param string $className
  * @return Oray_Dao_Abstract
  */
 public function getImDao($className)
 {
     if (!Zend_Registry::isRegistered($className)) {
         Zend_Registry::set($className, Oray_Dao::factory($className, $this->multidb->getDb('im')));
     }
     return Zend_Registry::get($className);
 }