[eluser]Frank Berger[/eluser]
you'd have to open a second db-connection in the hook or with a hook. I used the following code before, registered as pre_system and post_system hook:
file hooks/hookdb.php
Code:
if ( ! function_exists('hookdb_open')) {
function hookdb_open() {
global $HOOKDB;
require_once(BASEPATH.'database/DB'.EXT);
$HOOKDB = DB();
}
}
if ( ! function_exists('hookdb_close')) {
function hookdb_close() {
global $HOOKDB;
$HOOKDB->close();
}
}
file config/hooks.php
Code:
$hook['pre_system'][] = array('function'=>'hookdb_open','filename'=>'hookdb.php','filepath'=>'hooks');
$hook['post_system'][] = array('function'=>'hookdb_close','filename'=>'hookdb.php','filepath'=>'hooks');
you can access the database with $GLOBALS['HOOKDB']. Not sure right now, but I think in that setup you only have standard DB functionality, and no active records.
I used that in an unpublished package to overwrite settings in the config/*.php files from a database.
Frank