1 <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
4 * Library Singleton_db implements a factory that retrieves a single instance
5 * of a Database object for the whole CodeIgniter application.
7 * This avoids opening multiple connections to the same database and ensures
8 * that you obtain a Database object only when you need it.
11 * @author Călin-Andrei Burloiu
17 function __construct()
21 public static function connect()
25 $CI =& get_instance();
27 self::$db = $CI->load->database('default', TRUE);
34 /* End of file Singleton_db.php */
35 /* Location: ./application/libraries/Singleton_db.php */