- md5
- 1cf20aacc3fff2597094839ddab9fb16
- sha1
- 87c5ee8d797d56b80f2da23d9a555c153d343864
- sha256
- e7e8abe7cd84199dcdc7bc39d38d4e16a1025152e540ca81598eb23137e165ea
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
<?php
/**
* @package Joomla.Installation
*
* @copyright Copyright (C) 2005 - 2019 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 26 releases, Joomla 3.9.2-rc to 3.9.14. See them all, or every version of this file.