- md5
- 2f778a7ae7f4f3aa32e1ba7d01addcb7
- sha1
- f16923fe2ba0f538e003ba39fbe0692c36ed31f2
- sha256
- 5b3348c6e725abf1c27cb9451e536e797c9f18c172bcdee12f3219ffa2686590
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
<?php
/**
* @package Joomla.Installation
*
* @copyright Copyright (C) 2005 - 2014 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.
*
* @package Joomla.Installation
* @since 1.6
*/
abstract 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 13 releases, Joomla 3.2.2 to 3.3.6. See them all, or every version of this file.