Show Db.php syntax highlighted
<?php
/**
* Quantum Game Library
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the text file LICENSE located in the root
* directory of this library.
* It is also available through the internet at this URL:
* http://doc.astrumfutura.com/license.html
*
* If you did not receive a copy of the license and are unable to
* obtain it through the internet, please send an email
* to license@astrumfutura.com so we can send you a copy.
*
* @package Db
* @category Quantum
* @copyright Copyright (c) 2007 The QGL Group (refer to COPYRIGHT file)
* @version $Id: Db.php 275 2007-03-19 23:01:47Z maugrim_t_r $
* @license http://doc.astrumfutura.com/license.html New BSD License
*/
/** Quantum_Db_Exception */
require_once 'Quantum/Db/Exception.php';
/**
* @package Db
* @subpackage Factory
* @category Quantum
*/
class Quantum_Db {
/*
* Create a new Driver instance based on a configuration array.
*
* @param array $config
* @return Quantum_Db_Driver_Interface
*/
static public function factory(array $config)
{
switch($config['driver'])
{
case 'pdo_mysql':
require_once 'Quantum/Db/Driver/Pdo/Mysql.php';
$conn = new Quantum_Db_Driver_Pdo_Mysql($config);
break;
default:
throw new Quantum_Db_Exception($config['dbtype'] . ' is not a supported database type');
}
return $conn;
}
}
See more files for this project here