Skip to content
Permalink
Browse files

Renaming ConnectionManager::__getDriver() to ConnectionManager::__con…

…nectionData().
  • Loading branch information...
jperras committed Sep 25, 2009
1 parent c2ec960 commit f3d0769912c522e79b22a62d4779211b9b1b9856
Showing with 12 additions and 12 deletions.
  1. +12 −12 cake/libs/model/connection_manager.php
@@ -209,7 +209,7 @@ function enumConnectionObjects() {
if ($connections != null) {
foreach ($connections as $name => $config) {
$_this->_connectionsEnum[$name] = $_this->__getDriver($config);
$_this->_connectionsEnum[$name] = $_this->__connectionData($config);
}
return $_this->_connectionsEnum;
} else {
@@ -234,39 +234,39 @@ function &create($name = '', $config = array()) {
return $null;
}
$_this->config->{$name} = $config;
$_this->_connectionsEnum[$name] = $_this->__getDriver($config);
$_this->_connectionsEnum[$name] = $_this->__connectionData($config);
$return =& $_this->getDataSource($name);
return $return;
}
/**
* Returns the file, class name, and parent for the given driver.
*
* @return array An indexed array with: filename, classname, and parent
* @return array An indexed array with: filename, classname, plugin and parent
* @access private
*/
function __getDriver($config) {
function __connectionData($config) {
if (!isset($config['datasource'])) {
$config['datasource'] = 'dbo';
}
$filename = $classname = $parent = $plugin = null;
if (isset($config['driver']) && $config['driver'] != null && !empty($config['driver'])) {
$filename = $config['datasource'] . DS . $config['datasource'] . '_' . $config['driver'];
$classname = Inflector::camelize(strtolower($config['datasource'] . '_' . $config['driver']));
$parent = $this->__getDriver(array('datasource' => $config['datasource']));
if (!empty($config['driver'])) {
$source = $config['datasource'] . '_' . $config['driver'];
$filename = $config['datasource'] . DS . $source;
$classname = Inflector::camelize(strtolower($source));
$parent = $this->__connectionData(array('datasource' => $config['datasource']));
} else {
if (strpos($config['datasource'], '.') !== false) {
list($plugin, $classname) = explode('.', $config['datasource']);
$filename = Inflector::underscore($classname);
} else {
$filename = $config['datasource'] . '_source';
$classname = Inflector::camelize(strtolower($config['datasource'] . '_source'));
$classname = Inflector::camelize(strtolower($filename));
}
}
$driver = compact('filename', 'classname', 'parent', 'plugin');
return $driver;
return compact('filename', 'classname', 'parent', 'plugin');
}
/**

0 comments on commit f3d0769

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