Skip to content
Permalink
Browse files

Adding fallback path to plugin.

This matches the recent changes for the app dir.
Adding tests for the plugin variant.
  • Loading branch information...
markstory committed Jan 31, 2012
1 parent c47fe3e commit 6c7a14e482b1dd70ba5ff3a75225e52d16627c41
Showing with 10 additions and 4 deletions.
  1. +6 −3 lib/Cake/Core/App.php
  2. +4 −1 lib/Cake/Test/Case/Core/AppTest.php
@@ -229,7 +229,6 @@ public static function path($type, $plugin = null) {
$path[] = sprintf($f, $pluginPath);
}
}
$path[] = $pluginPath . 'Lib' . DS . $type . DS;
return $path;
}
@@ -540,8 +539,11 @@ public static function load($className) {
$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 @@ protected static function _packageFormat() {
'%s' . 'Locale' . DS
),
'Vendor' => array(
'%s' . 'Vendor' . DS, VENDORS
'%s' . 'Vendor' . DS,
VENDORS
),
'Plugin' => array(
APP . 'Plugin' . DS,
@@ -432,7 +432,7 @@ public function testPluginPath() {
}
/**
* test that pluginPath can find paths for plugins.
* test that themePath can find paths for themes.
*
* @return void
*/
@@ -567,6 +567,9 @@ public function testPluginImporting() {
$this->assertTrue($result);
$this->assertTrue(class_exists('TestSource'));
App::uses('ExampleExample', 'TestPlugin.Vendor/Example');
$this->assertTrue(class_exists('ExampleExample'));
App::build();
}

0 comments on commit 6c7a14e

Please sign in to comment.
You can’t perform that action at this time.