CoreFiles by mySites.guru
database.php56 lines, 1,412 bytes, from Joomla_3.9.21-Stable-Full_Package.zip
Raw History Compare with 3.9.20
md5
69d6c543a18e3ddf11fad8a751c68b13
sha1
3678dee8e2c55e3889b050367ffb605a23525e6f
sha256
27a3d1e58cb5d4602e070e57cbee1560140c3143ac02faa71586cbfa7abb9bbc
<?php
/**
 * @package    Joomla.Installation
 *
 * @copyright  Copyright (C) 2005 - 2020 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 30 releases, Joomla 3.9.15-rc to 3.10.0-alpha1. See them all, or every version of this file.