Adding fallback path to plugin.

This matches the recent changes for the app dir.
Adding tests for the plugin variant.
This commit is contained in:
mark_story 2012-01-30 22:21:00 -05:00
parent c47fe3e2ef
commit 6c7a14e482
2 changed files with 10 additions and 4 deletions

View file

@ -229,7 +229,6 @@ class App {
$path[] = sprintf($f, $pluginPath); $path[] = sprintf($f, $pluginPath);
} }
} }
$path[] = $pluginPath . 'Lib' . DS . $type . DS;
return $path; return $path;
} }
@ -540,8 +539,11 @@ class App {
$paths[] = $appLibs . $package . DS; $paths[] = $appLibs . $package . DS;
$paths[] = APP . $package . DS; $paths[] = APP . $package . DS;
$paths[] = CAKE . $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) { foreach ($paths as $path) {
$file = $path . $className . '.php'; $file = $path . $className . '.php';
if (file_exists($file)) { if (file_exists($file)) {
@ -857,7 +859,8 @@ class App {
'%s' . 'Locale' . DS '%s' . 'Locale' . DS
), ),
'Vendor' => array( 'Vendor' => array(
'%s' . 'Vendor' . DS, VENDORS '%s' . 'Vendor' . DS,
VENDORS
), ),
'Plugin' => array( 'Plugin' => array(
APP . 'Plugin' . DS, APP . 'Plugin' . DS,

View file

@ -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 * @return void
*/ */
@ -567,6 +567,9 @@ class AppTest extends CakeTestCase {
$this->assertTrue($result); $this->assertTrue($result);
$this->assertTrue(class_exists('TestSource')); $this->assertTrue(class_exists('TestSource'));
App::uses('ExampleExample', 'TestPlugin.Vendor/Example');
$this->assertTrue(class_exists('ExampleExample'));
App::build(); App::build();
} }