mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Merge pull request #348 from petteyg/apptheme
Make TemplateTask prioritize App templates over Core templates
This commit is contained in:
commit
d4fd1b3743
1 changed files with 4 additions and 2 deletions
|
@ -59,7 +59,7 @@ class TemplateTask extends AppShell {
|
||||||
* @return array Array of bake themes that are installed.
|
* @return array Array of bake themes that are installed.
|
||||||
*/
|
*/
|
||||||
protected function _findThemes() {
|
protected function _findThemes() {
|
||||||
$paths = App::path('Console');
|
$paths = array();
|
||||||
$core = current(App::core('Console'));
|
$core = current(App::core('Console'));
|
||||||
$separator = DS === '/' ? '/' : '\\\\';
|
$separator = DS === '/' ? '/' : '\\\\';
|
||||||
$core = preg_replace('#shells' . $separator . '$#', '', $core);
|
$core = preg_replace('#shells' . $separator . '$#', '', $core);
|
||||||
|
@ -70,10 +70,12 @@ class TemplateTask extends AppShell {
|
||||||
$themeFolders = $contents[0];
|
$themeFolders = $contents[0];
|
||||||
|
|
||||||
$plugins = App::objects('plugin');
|
$plugins = App::objects('plugin');
|
||||||
|
$paths[] = $core;
|
||||||
foreach ($plugins as $plugin) {
|
foreach ($plugins as $plugin) {
|
||||||
$paths[] = $this->_pluginPath($plugin) . 'Console' . DS;
|
$paths[] = $this->_pluginPath($plugin) . 'Console' . DS;
|
||||||
}
|
}
|
||||||
$paths[] = $core;
|
|
||||||
|
$paths = array_merge($paths, App::path('Console'));
|
||||||
|
|
||||||
// TEMPORARY TODO remove when all paths are DS terminated
|
// TEMPORARY TODO remove when all paths are DS terminated
|
||||||
foreach ($paths as $i => $path) {
|
foreach ($paths as $i => $path) {
|
||||||
|
|
Loading…
Reference in a new issue