mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
bame themes now in correct order: app -> plugin -> default
This commit is contained in:
parent
74ee75b0ef
commit
6353558622
2 changed files with 10 additions and 9 deletions
|
@ -55,11 +55,18 @@ class TemplateTask extends AppShell {
|
|||
* Find the paths to all the installed shell themes in the app.
|
||||
*
|
||||
* Bake themes are directories not named `skel` inside a `Console/Templates` path.
|
||||
* They are listed in this order: app -> plugin -> default
|
||||
*
|
||||
* @return array Array of bake themes that are installed.
|
||||
*/
|
||||
protected function _findThemes() {
|
||||
$paths = array();
|
||||
$paths = App::path('Console');
|
||||
|
||||
$plugins = App::objects('plugin');
|
||||
foreach ($plugins as $plugin) {
|
||||
$paths[] = $this->_pluginPath($plugin) . 'Console' . DS;
|
||||
}
|
||||
|
||||
$core = current(App::core('Console'));
|
||||
$separator = DS === '/' ? '/' : '\\\\';
|
||||
$core = preg_replace('#shells' . $separator . '$#', '', $core);
|
||||
|
@ -69,13 +76,7 @@ class TemplateTask extends AppShell {
|
|||
$contents = $Folder->read();
|
||||
$themeFolders = $contents[0];
|
||||
|
||||
$plugins = App::objects('plugin');
|
||||
$paths[] = $core;
|
||||
foreach ($plugins as $plugin) {
|
||||
$paths[] = $this->_pluginPath($plugin) . 'Console' . DS;
|
||||
}
|
||||
|
||||
$paths = array_merge($paths, App::path('Console'));
|
||||
|
||||
// TEMPORARY TODO remove when all paths are DS terminated
|
||||
foreach ($paths as $i => $path) {
|
||||
|
|
|
@ -134,7 +134,7 @@ class TemplateTaskTest extends CakeTestCase {
|
|||
|
||||
$result = $this->Task->generate('classes', 'test_object', array('test' => 'foo'));
|
||||
$expected = "I got rendered\nfoo";
|
||||
$this->assertEquals($expected, $result);
|
||||
$this->assertTextEquals($expected, $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue