Source for file database.php

Documentation is available at database.php

  1. <?php
  2. /**
  3.  * @package    Joomla.Installation
  4.  *
  5.  * @copyright  Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
  6.  * @license    GNU General Public License version 2 or later; see LICENSE.txt
  7.  */
  8.  
  9. defined('_JEXEC'or die;
  10.  
  11. /**
  12.  * Joomla Installation Database Helper Class.
  13.  *
  14.  * @package  Joomla.Installation
  15.  * @since    1.6
  16.  */
  17. {
  18.     /**
  19.      * Method to get a JDatabaseDriver object.
  20.      *
  21.      * @param   string   $driver    The database driver to use.
  22.      * @param   string   $host      The hostname to connect on.
  23.      * @param   string   $user      The user name to connect with.
  24.      * @param   string   $password  The password to use for connection authentication.
  25.      * @param   string   $database  The database to use.
  26.      * @param   string   $prefix    The table prefix to use.
  27.      * @param   boolean  $select    True if the database should be selected.
  28.      *
  29.      * @return  JDatabaseDriver 
  30.      *
  31.      * @since   1.6
  32.      */
  33.     public static function getDBO($driver$host$user$password$database$prefix$select true)
  34.     {
  35.         static $db;
  36.  
  37.         if (!$db)
  38.         {
  39.             // Build the connection options array.
  40.             $options array(
  41.                 'driver' => $driver,
  42.                 'host' => $host,
  43.                 'user' => $user,
  44.                 'password' => $password,
  45.                 'database' => $database,
  46.                 'prefix' => $prefix,
  47.                 'select' => $select
  48.             );
  49.  
  50.             // Get a database object.
  51.             $db JDatabaseDriver::getInstance($options);
  52.         }
  53.  
  54.         return $db;
  55.     }
  56. }

Documentation generated on Tue, 19 Nov 2013 14:57:52 +0100 by phpDocumentor 1.4.3