Esempio n. 1
0
 /**
  * Returns a reference to the global Database object, only creating it
  * if it doesn't already exist. And keeps sure that there is only one
  * instace for a specific combination of the JDatabase signature
  *
  * @param string  Database driver
  * @param string Database host
  * @param string Database user name
  * @param string Database user password
  * @param string Database name
  * @param string Common prefix for all tables
  * @return database A database object
  * @since 1.5
  */
 function &getInstance($driver = 'mysql', $host = 'localhost', $user, $pass, $db = '', $table_prefix = '')
 {
     $signature = serialize(array($driver, $host, $user, $pass, $db, $table_prefix));
     $database = JDatabase::_getStaticInstance($signature, 'JFDatabase', true);
     return $database;
 }