diff --git a/lib/Cake/Core/App.php b/lib/Cake/Core/App.php index 709fc8965..e203147e4 100644 --- a/lib/Cake/Core/App.php +++ b/lib/Cake/Core/App.php @@ -66,90 +66,6 @@ class App { 'plugin' => array('suffix' => '', 'extends' => null, 'core' => true) ); -/** - * List of additional path(s) where model files reside. - * - * @var array - */ - public static $models = array(); - -/** - * List of additional path(s) where behavior files reside. - * - * @var array - */ - public static $behaviors = array(); - -/** - * List of additional path(s) where controller files reside. - * - * @var array - */ - public static $controllers = array(); - -/** - * List of additional path(s) where component files reside. - * - * @var array - */ - public static $components = array(); - -/** - * List of additional path(s) where datasource files reside. - * - * @var array - */ - public static $datasources = array(); - -/** - * List of additional path(s) where libs files reside. - * - * @var array - */ - public static $libs = array(); - -/** - * List of additional path(s) where view files reside. - * - * @var array - */ - public static $views = array(); - -/** - * List of additional path(s) where helper files reside. - * - * @var array - */ - public static $helpers = array(); - -/** - * List of additional path(s) where plugins reside. - * - * @var array - */ - public static $plugins = array(); - -/** - * List of additional path(s) where vendor packages reside. - * - * @var array - */ - public static $vendors = array(); - -/** - * List of additional path(s) where locale files reside. - * - * @var array - */ - public static $locales = array(); - -/** - * List of additional path(s) where console shell files reside. - * - * @var array - */ - public static $shells = array(); - /** * Paths to search for files. * @@ -218,7 +134,7 @@ class App { private static $__packageFormat = array(); /** - * Maps an old style cakephp class type to the corresponding package + * Maps an old style CakePHP class type to the corresponding package * */ public static $legacy = array( @@ -445,10 +361,6 @@ class App { $includeDirectories = false; $name = $type; - if (isset(self::$legacy[$type . 's'])) { - $type = self::$legacy[$type . 's']; - } - if ($type === 'plugin') { $type = 'plugins'; } @@ -460,6 +372,10 @@ class App { list($plugin, $type) = pluginSplit($type); + if (isset(self::$legacy[$type . 's'])) { + $type = self::$legacy[$type . 's']; + } + if ($type === 'file' && !$path) { return false; } elseif ($type === 'file') { @@ -479,6 +395,7 @@ class App { if (empty($path)) { $path = self::path($type, $plugin); } + $items = array(); foreach ((array)$path as $dir) { diff --git a/lib/Cake/View/pages/home.ctp b/lib/Cake/View/pages/home.ctp index 319422586..4c51432de 100644 --- a/lib/Cake/View/pages/home.ctp +++ b/lib/Cake/View/pages/home.ctp @@ -24,7 +24,7 @@ App::import('Core', 'Debugger'); 0): - //Debugger::checkSecurityKeys(); + Debugger::checkSecurityKeys(); endif; ?>
diff --git a/lib/Cake/tests/cases/libs/app.test.php b/lib/Cake/tests/cases/libs/app.test.php index 5ddeba067..6a0f3657b 100644 --- a/lib/Cake/tests/cases/libs/app.test.php +++ b/lib/Cake/tests/cases/libs/app.test.php @@ -260,32 +260,45 @@ class AppImportTest extends CakeTestCase { */ function testListObjectsInPlugin() { App::build(array( - 'models' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'models' . DS), - 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS) + 'Model' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'models' . DS), + 'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS) )); - $oldCache = App::$models; $result = App::objects('TestPlugin.model'); $this->assertTrue(in_array('TestPluginPost', $result)); - $this->assertEquals($oldCache, App::$models); + $result = App::objects('TestPlugin.Model'); + $this->assertTrue(in_array('TestPluginPost', $result)); $result = App::objects('TestPlugin.behavior'); $this->assertTrue(in_array('TestPluginPersisterOne', $result)); + $result = App::objects('TestPlugin.Model/Behavior'); + $this->assertTrue(in_array('TestPluginPersisterOne', $result)); $result = App::objects('TestPlugin.helper'); - $expected = array('OtherHelper', 'PluggedHelper', 'TestPluginApp'); + $expected = array('OtherHelperHelper', 'PluggedHelper', 'TestPluginApp'); + $this->assertEquals($result, $expected); + $result = App::objects('TestPlugin.View/Helper'); + $expected = array('OtherHelperHelper', 'PluggedHelper', 'TestPluginApp'); $this->assertEquals($result, $expected); $result = App::objects('TestPlugin.component'); $this->assertTrue(in_array('OtherComponent', $result)); + $result = App::objects('TestPlugin.Controller/Component'); + $this->assertTrue(in_array('OtherComponent', $result)); $result = App::objects('TestPluginTwo.behavior'); $this->assertEquals($result, array()); + $result = App::objects('TestPluginTwo.Model/Behavior'); + $this->assertEquals($result, array()); $result = App::objects('model', null, false); $this->assertTrue(in_array('Comment', $result)); $this->assertTrue(in_array('Post', $result)); + $result = App::objects('Model', null, false); + $this->assertTrue(in_array('Comment', $result)); + $this->assertTrue(in_array('Post', $result)); + App::build(); } @@ -319,7 +332,7 @@ class AppImportTest extends CakeTestCase { */ function testThemePath() { App::build(array( - 'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS) + 'View' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS) )); $path = App::themePath('test_theme'); $expected = LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'themed' . DS . 'test_theme' . DS;