diff --git a/lib/Cake/Core/App.php b/lib/Cake/Core/App.php index d96f41829..b105b0633 100644 --- a/lib/Cake/Core/App.php +++ b/lib/Cake/Core/App.php @@ -229,7 +229,6 @@ class App { $path[] = sprintf($f, $pluginPath); } } - $path[] = $pluginPath . 'Lib' . DS . $type . DS; return $path; } @@ -540,8 +539,11 @@ class App { $paths[] = $appLibs . $package . DS; $paths[] = APP . $package . DS; $paths[] = CAKE . $package . DS; + } else { + $pluginPath = self::pluginPath($plugin); + $paths[] = $pluginPath . 'Lib' . DS . $package . DS; + $paths[] = $pluginPath . $package . DS; } - foreach ($paths as $path) { $file = $path . $className . '.php'; if (file_exists($file)) { @@ -857,7 +859,8 @@ class App { '%s' . 'Locale' . DS ), 'Vendor' => array( - '%s' . 'Vendor' . DS, VENDORS + '%s' . 'Vendor' . DS, + VENDORS ), 'Plugin' => array( APP . 'Plugin' . DS, diff --git a/lib/Cake/Test/Case/Core/AppTest.php b/lib/Cake/Test/Case/Core/AppTest.php index ed956d679..465717bf6 100644 --- a/lib/Cake/Test/Case/Core/AppTest.php +++ b/lib/Cake/Test/Case/Core/AppTest.php @@ -432,7 +432,7 @@ class AppTest extends CakeTestCase { } /** - * test that pluginPath can find paths for plugins. + * test that themePath can find paths for themes. * * @return void */ @@ -567,6 +567,9 @@ class AppTest extends CakeTestCase { $this->assertTrue($result); $this->assertTrue(class_exists('TestSource')); + App::uses('ExampleExample', 'TestPlugin.Vendor/Example'); + $this->assertTrue(class_exists('ExampleExample')); + App::build(); }