- md5
- a478c35306284138936d556324de4fb3
- sha1
- 5f775a01796004fd304d1fd7b5d68fcff612e1d0
- sha256
- 84a83bab7043cbe89cde099c28ce5a3d43be8aa2a33e8710a56c2624e3840721
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
<?php
/**
* @package Joomla.Installation
*
* @copyright Copyright (C) 2005 - 2017 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 34 releases, Joomla 3.7.0-alpha2 to 3.8.3. See them all, or every version of this file.