From 3f8c959ab3617330de700cbd267ccafe1b5eca58 Mon Sep 17 00:00:00 2001 From: "renan.saddam" Date: Wed, 24 Sep 2008 13:37:06 +0000 Subject: [PATCH] small refactoring for the ClassRegistry git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7656 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/libs/class_registry.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cake/libs/class_registry.php b/cake/libs/class_registry.php index c243a9e8d..45b7307eb 100644 --- a/cake/libs/class_registry.php +++ b/cake/libs/class_registry.php @@ -111,13 +111,13 @@ class ClassRegistry { $count = count($objects); foreach ($objects as $key => $settings) { if (is_array($settings)) { - $plugin = null; + $plugin = $pluginPath = null; $settings = array_merge($defaults, $settings); $class = $settings['class']; if (strpos($class, '.') !== false) { list($plugin, $class) = explode('.', $class); - $plugin = $plugin . '.'; + $pluginPath = $plugin . '.'; } if (empty($settings['alias'])) { @@ -130,10 +130,9 @@ class ClassRegistry { return $model; } - if (class_exists($class) || App::import($type, $plugin . $class)) { + if (class_exists($class) || App::import($type, $pluginPath . $class)) { ${$class} =& new $class($settings); } elseif ($type === 'Model') { - $plugin = substr($plugin, 0, -1); if ($plugin && class_exists($plugin . 'AppModel')) { $appModel = $plugin . 'AppModel'; } else {