Permalink
Browse files

Minor refactor of ConnectionManager::__connectionData(). Uses pluginS…

…plit() now to consolidate plugin dot notation handling.
  • Loading branch information...
1 parent 2279b1a commit eb96f4ac3a60b0354baf9c396ebf5d9fb236fb0a @markstory markstory committed Feb 17, 2010
Showing with 4 additions and 4 deletions.
  1. +4 −4 cake/libs/model/connection_manager.php
@@ -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';

0 comments on commit eb96f4a

Please sign in to comment.