CoreFiles by mySites.guru
database.php58 lines, 1,448 bytes, from Joomla_3.0.3-Stable-Full_Package.zip
Raw History Compare with 3.0.2
md5
fe1fb870ad21c549bab0c82ce42cc6e7
sha1
aa299efe0b7a210b74f4af5235420a10ff813fcc
sha256
155df5dcce1737521a888abad2720d5192bcab2d9d29bcae55ef5ade633ca187
<?php
/**
 * @package    Joomla.Installation
 *
 * @copyright  Copyright (C) 2005 - 2013 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.
 *
 * @static
 * @package  Joomla.Installation
 * @since    1.6
 */
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 2 releases, Joomla 3.0.3 to 3.0.4. See them all, or every version of this file.