Source for file LDatabase.php
Documentation is available at LDatabase.php
* @license http://opensource.org/licenses/mozilla1.1.php Mozilla Public License
* @copyright 2005, diemeisterei GmbH. All rights reserved.
* @author $Author: schmunk $
* @version $Revision: 601 $ $Date: 2007-02-24 23:49:30 +0100 (Sa, 24 Feb 2007) $
* @package Phundament.Packages
* Provides database intialization and access.
Prado :: using("Library.propel.*");
Prado :: using("Library.propel.runtime.classes.propel.util.*");
Prado :: using("Library.propel.runtime.classes.propel.adapter.*");
Prado :: using("Library.propel.runtime.classes.propel.map.*");
Prado :: using("Library.propel.runtime.classes.propel.om.*");
Prado :: using("Library.propel.runtime.classes.propel.*");
Prado :: using("Library.propel.runtime.classes.*");
Prado :: using("Library.creole.classes.creole.common.*");
Prado :: using("Library.creole.classes.creole.drivers.sqlite.*");
Prado :: using("Library.creole.classes.creole.drivers.mysql.*");
Prado :: using("Library.creole.classes.creole.*");
Prado :: using("Library.creole.classes.*");
Prado :: using("Library.log.*");
Prado :: using("Library.log.Log.*");
* Location of master config file
private $_masterConfigFile;
* Returns location of config file (within package dir)
return $this->_masterConfigFile;
* Sets location of config file (within package dir)
$this->_masterConfigFile= $value;
* Inits database configutation
public function init($config)
Prado :: trace("LDatabase initialized ", 'Lithron.LDatabase');
* Returns a propel or creole (which is faster) connection
if (isset ($connections[$layer . ":" . $name]))
Prado :: trace("Returning pooled connection ($name) with $layer ... ", 'Lithron.LDatabase');
return $connections[$layer . ":" . $name];
$this->DatabaseConfig->_config['propel']['datasources'][$name]= $this->DatabaseConfig->_config['propel']['datasources']["development"]; // TODO
$conn= LCreole :: getConnection($dsn, Creole :: PERSISTENT);
Prado :: trace("Returning connection ($name) with $layer ... ", 'Lithron.LDatabase');
$connections[$layer . ":" . $name]= $conn;
|