- md5
- 459a35cc6796eb43dea040fa9fe4f4ac
- sha1
- 7bbc4e8cb13c5e7fc41e322ba6b9d3f2e03cab19
- sha256
- b33e484aae70163f11f1e21d2f3253db5f6fcaecba8fb297d47b2dac4941cd12
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
<?php
/**
* @version $Id: database.php 22338 2011-11-04 17:24:53Z github_bot $
* @package Joomla.Installation
* @copyright Copyright (C) 2005 - 2011 Open Source Matters. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
/**
* Joomla Installation Database Helper Class.
*
* @static
* @package Joomla.Installation
* @since 1.6
*/
class JInstallationHelperDatabase
{
/**
* Method to get a JDatabase object.
*
* @param string $driver The database driver to use.
* @param string $host The hostname to connect on.
* @param string $user The user name to connect with.
* @param string $password The password to use for connection authentication.
* @param string $database The database to use.
* @param string $prefix The table prefix to use.
* @param boolean $select True if the database should be selected.
*
* @return mixed JDatabase object on success, JException on error.
* @since 1.0
*/
public static function & getDBO($driver, $host, $user, $password, $database, $prefix, $select = true)
{
static $db;
if (!$db) {
// Build the connection options array.
$options = array (
'driver' => $driver,
'host' => $host,
'user' => $user,
'password' => $password,
'database' => $database,
'prefix' => $prefix,
'select' => $select
);
// Get a database object.
jimport('joomla.database.database');
$db = JDatabase::getInstance($options);
}
return $db;
}
}
The same content is in 3 releases, Joomla 1.7.3 to 1.7.5. See them all, or every version of this file.