Skip to content
Permalink
Browse files

Removing E_STRICT errors from connection manager

  • Loading branch information...
lorenzo committed Nov 9, 2010
1 parent 2fa653d commit afa5ee688535ce44efc4f1829699de19ff8cac5a
Showing with 12 additions and 12 deletions.
  1. +12 −12 cake/libs/model/connection_manager.php
@@ -60,7 +60,7 @@ class ConnectionManager {
*/
function __construct() {
if (class_exists('DATABASE_CONFIG')) {
$this->config =& new DATABASE_CONFIG();
$this->config = new DATABASE_CONFIG();
$this->_getConnectionObjects();
}
}
@@ -74,7 +74,7 @@ public static function &getInstance() {
static $instance = array();
if (!$instance) {
$instance[0] =& new ConnectionManager();
$instance[0] = new ConnectionManager();
}
return $instance[0];
@@ -87,10 +87,10 @@ public static function &getInstance() {
* @return object Instance
*/
public static function &getDataSource($name) {
$_this =& ConnectionManager::getInstance();
$_this = ConnectionManager::getInstance();
if (!empty($_this->_dataSources[$name])) {
$return =& $_this->_dataSources[$name];
$return = $_this->_dataSources[$name];
return $return;
}
@@ -107,10 +107,10 @@ public static function &getDataSource($name) {
$null = null;
return $null;
}
$_this->_dataSources[$name] =& new $class($_this->config->{$name});
$_this->_dataSources[$name] = new $class($_this->config->{$name});
$_this->_dataSources[$name]->configKeyName = $name;
$return =& $_this->_dataSources[$name];
$return = $_this->_dataSources[$name];
return $return;
}
@@ -120,7 +120,7 @@ public static function &getDataSource($name) {
* @return array List of available connections
*/
public static function sourceList() {
$_this =& ConnectionManager::getInstance();
$_this = ConnectionManager::getInstance();
return array_keys($_this->_dataSources);
}
@@ -134,7 +134,7 @@ public static function sourceList() {
* in the ConnectionManager.
*/
public static function getSourceName(&$source) {
$_this =& ConnectionManager::getInstance();
$_this = ConnectionManager::getInstance();
foreach ($_this->_dataSources as $name => $ds) {
if ($ds == $source) {
return $name;
@@ -152,7 +152,7 @@ public static function getSourceName(&$source) {
* @return boolean True on success, null on failure or false if the class is already loaded
*/
public static function loadDataSource($connName) {
$_this =& ConnectionManager::getInstance();
$_this = ConnectionManager::getInstance();
if (is_array($connName)) {
$conn = $connName;
@@ -185,7 +185,7 @@ public static function loadDataSource($connName) {
* (as defined in Connections), and the value is an array with keys 'filename' and 'classname'.
*/
public static function enumConnectionObjects() {
$_this =& ConnectionManager::getInstance();
$_this = ConnectionManager::getInstance();
return $_this->_connectionsEnum;
}
@@ -197,15 +197,15 @@ public static function enumConnectionObjects() {
* @return object A reference to the DataSource object, or null if creation failed
*/
public static function &create($name = '', $config = array()) {
$_this =& ConnectionManager::getInstance();
$_this = ConnectionManager::getInstance();
if (empty($name) || empty($config) || array_key_exists($name, $_this->_connectionsEnum)) {
$null = null;
return $null;
}
$_this->config->{$name} = $config;
$_this->_connectionsEnum[$name] = $_this->__connectionData($config);
$return =& $_this->getDataSource($name);
$return = $_this->getDataSource($name);
return $return;
}

0 comments on commit afa5ee6

Please sign in to comment.
You can’t perform that action at this time.