daily pastebin goal
87%
SHARE
TWEET

Untitled

a guest Jan 21st, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     public function database($params = '', $return = FALSE, $active_record = NULL)
  2.     {
  3.         // Grab the super object
  4.         $CI =& get_instance();
  5.  
  6.         // Do we even need to load the database class?
  7.         if (class_exists('CI_DB') AND $return == FALSE AND $active_record == NULL AND isset($CI->db) AND is_object($CI->db))
  8.         {
  9.             return FALSE;
  10.         }
  11.  
  12.         require_once(BASEPATH.'database/DB.php');
  13.  
  14.         if ($return === TRUE)
  15.         {
  16.             return DB($params, $active_record);
  17.         }
  18.  
  19.         // Initialize the db variable.  Needed to prevent
  20.         // reference errors with some configurations
  21.         $CI->db = '';
  22.  
  23.         // Load the DB class
  24.         $CI->db =& DB($params, $active_record);
  25.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top