mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
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:
parent
c47fe3e2ef
commit
6c7a14e482
2 changed files with 10 additions and 4 deletions
|
@ -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,
|
||||||
|
|
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue