- md5
- 7aa63c49260587f9e9e7d73607ed304f
- sha1
- e751f5b182dd22e3887a3cf00edd97b3d5d1a19e
- sha256
- c85611dbd48f65aca91a94c64d891699fa724cd06f24b09332494fa6805b9585
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
<?php
/**
* @package Joomla.Installation
*
* @copyright Copyright (C) 2005 - 2015 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.
*
* @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 9 releases, Joomla 3.4.4-rc to 3.5.0-beta. See them all, or every version of this file.