Cache Manager resource
Example configuration:
resources.multidb.defaultMetadataCache = "database" resources.multidb.db1.adapter = "pdo_mysql" resources.multidb.db1.host = "localhost" resources.multidb.db1.username = "webuser" resources.multidb.db1.password = "XXXX" resources.multidb.db1.dbname = "db1" resources.multidb.db1.default = true resources.multidb.db2.adapter = "pdo_pgsql" resources.multidb.db2.host = "example.com" resources.multidb.db2.username = "dba" resources.multidb.db2.password = "notthatpublic" resources.multidb.db2.dbname = "db2"
category | Zend |
---|---|
package | Zend_Application |
subpackage | Resource |
copyright | Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) |
license | New BSD License |
inherited_from | \Zend_Application_Resource_ResourceAbstract |
__construct(mixed $options = null
)
Must take an optional single argument, $options.
inherited_from | \Zend_Application_Resource_Resource::__construct() |
---|
mixed
getBootstrap() : null | \Zend_Application_Bootstrap_Bootstrapper
inherited_from | \Zend_Application_Resource_Resource::getBootstrap() |
---|
null
\Zend_Application_Bootstrap_Bootstrapper
getDb(null|string|\Zend_Db_Adapter_Abstract $db = null
) : \Zend_Db_Adapter_Abstract
null
string
\Zend_Db_Adapter_Abstract
The adapter to retrieve. Null to retrieve the default connection
\Zend_Application_Resource_Exception |
if the given parameter could not be found |
---|
\Zend_Db_Adapter_Abstract
getDefaultDb(boolean $justPickOne = true
) : null | \Zend_Db_Adapter_Abstract
boolean
If true, a random (the first one in the stack) connection is returned if no default was set. If false, null is returned if no default was set.
null
\Zend_Db_Adapter_Abstract
getOptions() : array
inherited_from | \Zend_Application_Resource_Resource::getOptions() |
---|
array
init() : \Zend_Application_Resource_Multidb
\Zend_Application_Resource_Multidb
isDefault(string|\Zend_Db_Adapter_Abstract $db) : boolean
string
\Zend_Db_Adapter_Abstract
The db to determine whether it's set as default
boolean
True if the given parameter is configured as default. False otherwisemergeOptions(array $array1, mixed $array2 = null
) : array
array
mixed
array
setBootstrap(\Zend_Application_Bootstrap_Bootstrapper $bootstrap) : \Zend_Application_Resource_Resource
inherited_from | \Zend_Application_Resource_Resource::setBootstrap() |
---|
\Zend_Application_Bootstrap_Bootstrapper
\Zend_Application_Resource_Resource
setOptions(array $options) : \Zend_Application_Resource_ResourceAbstract
inherited_from | \Zend_Application_Resource_Resource::setOptions() |
---|
array
Configuration for resource
\Zend_Application_Resource_ResourceAbstract
_setDefault(\Zend_Db_Adapter_Abstract $adapter)
var | Adapter to set as default |
---|
_setDefaultMetadataCache(string|\Zend_Cache_Core $cache) : \Zend_Application_Resource_Multidb
string
\Zend_Cache_Core
\Zend_Application_Resource_Multidb
$_bootstrap : \Zend_Application_Bootstrap_Bootstrapper
$_dbs : array
array()
$_defaultDb : null | \Zend_Db_Adapter_Abstract
$_skipOptions : array
array('options', 'config')