Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Minor refactor of ConnectionManager::__connectionData(). Uses pluginS…
…plit() now to consolidate plugin dot notation handling.
  • Loading branch information
markstory committed Feb 17, 2010
1 parent 2279b1a commit eb96f4a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cake/libs/model/connection_manager.php
Expand Up @@ -259,17 +259,17 @@ function __connectionData($config) {
$parent = $this->__connectionData(array('datasource' => $config['datasource']));
$parentSource = preg_replace('/_source$/', '', $parent['filename']);

if (strpos($config['driver'], '.') !== false) {
list($plugin, $classname) = explode('.', $config['driver']);
list($plugin, $classname) = pluginSplit($config['driver']);
if ($plugin) {
$source = Inflector::underscore($classname);
} else {
$source = $parentSource . '_' . $config['driver'];
$classname = Inflector::camelize(strtolower($source));
}
$filename = $parentSource . DS . $source;
} else {
if (strpos($config['datasource'], '.') !== false) {
list($plugin, $classname) = explode('.', $config['datasource']);
list($plugin, $classname) = pluginSplit($config['datasource']);
if ($plugin) {
$filename = Inflector::underscore($classname);
} else {
$filename = $config['datasource'] . '_source';
Expand Down

0 comments on commit eb96f4a

Please sign in to comment.