- md5
- f1429c1d63c74b1d9cc685ae81e0dbc7
- sha1
- 7e29bb25cfcb07d417f4d306a929a629a920ecec
- sha256
- a3dcf7e64015006c336fd25bf06a19cebc12ccc1144ef02e4a6de8177a253c7a
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
<?php
/**
* @package Joomla.Installation
*
* @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Joomla Installation Database Helper Class.
*
* @static
* @package Joomla.Installation
* @since 1.6
*/
class InstallationHelperDatabase
{
/**
* Method to get a JDatabaseDriver 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 JDatabaseDriver
*
* @since 1.6
*/
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.
$db = JDatabaseDriver::getInstance($options);
}
return $db;
}
}
The same content is in 3 releases, Joomla 3.0.0 to 3.0.2. See them all, or every version of this file.