DataObject Multiples Dbs
| From: | Ian Warner | Date: | Fri, 16 Feb 2007 19:05:46 +0000 |
| Subject: | DataObject Multiples Dbs | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-26600@lists.php.net to get a copy of this message | ||
I basically have this below:
Now as you can see sometimes I have a multiple DB situation if a package in my MVC FW requires to use it. I like to split the DB up as some packages have a large number of tables and contain then in one DB is too much.
however the issues is that I would also like to keep the class location and schema location in seperate folders also.
At the moment from the docs I see no indication on how to do that.
do I - database_class_location do this? - tries and didn't work.
any help appreciated on this
require ST_INCLUDES . 'Data_Objects/Inter.php';
$config['DB_DataObject'] =
array(
'database_' . USE_DB => 'mysqli://user:pass@localhost/' . USE_DB,
'schema_location' => ST_DO . USE_DB,
'class_location' => ST_DO . USE_DB,
'require_prefix' => ST_DO . USE_DB,
'class_prefix' => 'DO_',
'db_driver' => 'MDB2',
'extends_location' => ST_DO . 'Inter.php',
'extends' => 'DB_Inter',
'quote_identifiers' => true,
'ignore_sequence_keys' => 'ALL'
);
// If a package is called for then include its constants here to set DB up.
if (!empty($_GET['d']) && $_GET['d'] == 'packages') {
require ST_PACKAGES . $_GET['p'] . DIRECTORY_SEPARATOR . 'constants.php';
}
if (defined('USE_PACKAGE_DB')) {
$config['DB_DataObject'] += array('database_' . USE_PACKAGE_DB => 'mysqli://user:pass@localhost/' . USE_PACKAGE_DB);
}
$options =& PEAR::getStaticProperty('DB_DataObject', 'options');
$options = $config['DB_DataObject'];