Skip to content

Instantly share code, notes, and snippets.

@chonthu
Created February 23, 2012 16:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chonthu/1893482 to your computer and use it in GitHub Desktop.
Save chonthu/1893482 to your computer and use it in GitHub Desktop.
on_duplicate_update 3
require_once(BASEPATH.'database/DB_driver.php');
if ( ! isset($active_record) OR $active_record == TRUE)
{
require_once(BASEPATH.'database/DB_active_rec'.EXT);
// get the CI instance
$CI = & get_instance();
$prefix = $CI->config->item('subclass_prefix');
if (file_exists(APPPATH.'core/'.$prefix.'DB_active_rec'.EXT))
{
require_once(APPPATH.'core/'.$prefix.'DB_active_rec'.EXT);
if ( ! class_exists('CI_DB'))
{
eval('class CI_DB extends '.$prefix.'DB_active_record { }');
}
}
else
{
if ( ! class_exists('CI_DB'))
{
eval('class CI_DB extends CI_DB_active_record { }');
}
}
}
else
{
if ( ! class_exists('CI_DB'))
{
eval('class CI_DB extends CI_DB_driver { }');
}
}
require_once(BASEPATH.'database/drivers/'.$params['dbdriver'].'/'.$params['dbdriver'].'_driver.php');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment