diff --git a/cake/libs/configure.php b/cake/libs/configure.php index 448db7ae3bc..d75de6b1096 100644 --- a/cake/libs/configure.php +++ b/cake/libs/configure.php @@ -677,9 +677,9 @@ function build($paths = array(), $reset = false) { function pluginPath($plugin) { $_this =& App::getInstance(); $pluginDir = Inflector::underscore($plugin); - foreach ($_this->plugins as $path) { - if (is_dir($path . $pluginDir)) { - return $path . $pluginDir . DS ; + for ($i = 0, $length = count($_this->plugins); $i < $length; $i++) { + if (is_dir($_this->plugins[$i] . $pluginDir)) { + return $_this->plugins[$i] . $pluginDir . DS ; } } return $_this->plugins[0] . $pluginDir . DS; diff --git a/cake/libs/i18n.php b/cake/libs/i18n.php index 6082bb94075..1e7806194fb 100644 --- a/cake/libs/i18n.php +++ b/cake/libs/i18n.php @@ -272,14 +272,10 @@ function __bindTextDomain($domain) { $plugins = App::objects('plugin'); if (!empty($plugins)) { - $pluginPaths = App::path('plugins'); - foreach ($plugins as $plugin) { $plugin = Inflector::underscore($plugin); if ($plugin === $domain) { - foreach ($pluginPaths as $pluginPath) { - $searchPaths[] = $pluginPath . $plugin . DS . 'locale' . DS; - } + $searchPaths[] = App::pluginPath($plugin) . DS . 'locale' . DS; $searchPaths = array_reverse($searchPaths); break; } diff --git a/cake/libs/view/view.php b/cake/libs/view/view.php index 0c3aa4b26ca..0254381f6c5 100644 --- a/cake/libs/view/view.php +++ b/cake/libs/view/view.php @@ -937,12 +937,7 @@ function _paths($plugin = null, $cached = true) { $paths[] = $viewPaths[$i] . 'plugins' . DS . $plugin . DS; } } - $pluginPaths = App::path('plugins'); - $count = count($pluginPaths); - - for ($i = 0; $i < $count; $i++) { - $paths[] = $pluginPaths[$i] . $plugin . DS . 'views' . DS; - } + $paths[] = App::pluginPath($plugin) . 'views' . DS; } $paths = array_merge($paths, $viewPaths); diff --git a/cake/tests/lib/cake_test_case.php b/cake/tests/lib/cake_test_case.php index d21d4fa4533..c37dfb5c4e0 100644 --- a/cake/tests/lib/cake_test_case.php +++ b/cake/tests/lib/cake_test_case.php @@ -1,6 +1,4 @@ - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.cake.tests.libs * @since CakePHP(tm) v 1.2.0.4667 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License */ if (!class_exists('dispatcher')) { @@ -67,7 +62,7 @@ function testCase(&$testCase) { * @param array $params * @param boolean $missingAction * @return Controller - * @access proptected + * @access protected */ function _invoke(&$controller, $params, $missingAction = false) { $this->controller =& $controller; @@ -775,13 +770,7 @@ function _loadFixtures() { TESTS . 'fixtures', VENDORS . 'tests' . DS . 'fixtures' ); - $pluginPaths = App::path('plugins'); - foreach ($pluginPaths as $path) { - if (file_exists($path . $pluginName . DS . 'tests' . DS. 'fixtures')) { - $fixturePaths[0] = $path . $pluginName . DS . 'tests' . DS. 'fixtures'; - break; - } - } + $fixturesPaths[0] = App::pluginPath($pluginName) . DS . 'tests' . DS . 'fixtures'; } else { $fixturePaths = array( TESTS . 'fixtures',