mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Camelized templates folder.
This commit is contained in:
parent
192812ee7f
commit
21348169fa
77 changed files with 14 additions and 15 deletions
|
@ -140,7 +140,7 @@ class ProjectTask extends Shell {
|
|||
$skel = $this->in(
|
||||
__d('cake_console', "What is the path to the directory layout you wish to copy?"),
|
||||
null,
|
||||
CAKE . 'Console' . DS . 'templates' . DS . 'skel'
|
||||
CAKE . 'Console' . DS . 'Templates' . DS . 'skel'
|
||||
);
|
||||
if (!$skel) {
|
||||
$this->err(__d('cake_console', 'The directory path you supplied was empty. Please try again.'));
|
||||
|
@ -149,7 +149,7 @@ class ProjectTask extends Shell {
|
|||
$skel = $this->in(
|
||||
__d('cake_console', 'Directory path does not exist please choose another:'),
|
||||
null,
|
||||
CAKE . 'Console' . DS . 'templates' . DS . 'skel'
|
||||
CAKE . 'Console' . DS . 'Templates' . DS . 'skel'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -203,7 +203,7 @@ class ProjectTask extends Shell {
|
|||
public function createHome($dir) {
|
||||
$app = basename($dir);
|
||||
$path = $dir . 'View' . DS . 'Pages' . DS;
|
||||
$source = CAKE . 'Console' . DS . 'templates' . DS .'default' . DS . 'views' . DS . 'home.ctp';
|
||||
$source = CAKE . 'Console' . DS . 'Templates' . DS .'default' . DS . 'views' . DS . 'home.ctp';
|
||||
include($source);
|
||||
return $this->createFile($path.'home.ctp', $output);
|
||||
}
|
||||
|
@ -388,8 +388,8 @@ class ProjectTask extends Shell {
|
|||
))->addOption('empty', array(
|
||||
'help' => __d('cake_console', 'Create empty files in each of the directories. Good if you are using git')
|
||||
))->addOption('skel', array(
|
||||
'default' => current(App::core('Console')) . 'templates' . DS . 'skel',
|
||||
'help' => __d('cake_console', 'The directory layout to use for the new application skeleton. Defaults to cake/console/templates/skel of CakePHP used to create the project.')
|
||||
'default' => current(App::core('Console')) . 'Templates' . DS . 'skel',
|
||||
'help' => __d('cake_console', 'The directory layout to use for the new application skeleton. Defaults to cake/Console/Templates/skel of CakePHP used to create the project.')
|
||||
));
|
||||
}
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ class TemplateTask extends Shell {
|
|||
/**
|
||||
* Find the paths to all the installed shell themes in the app.
|
||||
*
|
||||
* Bake themes are directories not named `skel` inside a `vendors/shells/templates` path.
|
||||
* Bake themes are directories not named `skel` inside a `Console/Templates` path.
|
||||
*
|
||||
* @return array Array of bake themes that are installed.
|
||||
*/
|
||||
|
@ -59,15 +59,14 @@ class TemplateTask extends Shell {
|
|||
$separator = DS === '/' ? '/' : '\\\\';
|
||||
$core = preg_replace('#shells' . $separator . '$#', '', $core);
|
||||
|
||||
$Folder = new Folder($core . 'templates' . DS . 'default');
|
||||
$Folder = new Folder($core . 'Templates' . DS . 'default');
|
||||
|
||||
$contents = $Folder->read();
|
||||
$themeFolders = $contents[0];
|
||||
|
||||
$plugins = App::objects('plugin');
|
||||
foreach ($plugins as $plugin) {
|
||||
$paths[] = $this->_pluginPath($plugin) . 'console' . DS . 'shells' . DS;
|
||||
$paths[] = $this->_pluginPath($plugin) . 'vendors' . DS . 'shells' . DS;
|
||||
$paths[] = $this->_pluginPath($plugin) . 'Console' . DS;
|
||||
}
|
||||
$paths[] = $core;
|
||||
|
||||
|
@ -78,18 +77,18 @@ class TemplateTask extends Shell {
|
|||
|
||||
$themes = array();
|
||||
foreach ($paths as $path) {
|
||||
$Folder = new Folder($path . 'templates', false);
|
||||
$Folder = new Folder($path . 'Templates', false);
|
||||
$contents = $Folder->read();
|
||||
$subDirs = $contents[0];
|
||||
foreach ($subDirs as $dir) {
|
||||
if (empty($dir) || preg_match('@^skel$|_skel$@', $dir)) {
|
||||
continue;
|
||||
}
|
||||
$Folder = new Folder($path . 'templates' . DS . $dir);
|
||||
$Folder = new Folder($path . 'Templates' . DS . $dir);
|
||||
$contents = $Folder->read();
|
||||
$subDirs = $contents[0];
|
||||
if (array_intersect($contents[0], $themeFolders)) {
|
||||
$templateDir = $path . 'templates' . DS . $dir . DS;
|
||||
$templateDir = $path . 'Templates' . DS . $dir . DS;
|
||||
$themes[$dir] = $templateDir;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -88,7 +88,7 @@ class UpgradeShell extends Shell {
|
|||
|
||||
$moves = array(
|
||||
'libs' => 'Lib',
|
||||
'vendors' . DS . 'shells' . DS . 'templates' => 'Console' . DS . 'templates',
|
||||
'vendors' . DS . 'shells' . DS . 'templates' => 'Console' . DS . 'Templates',
|
||||
);
|
||||
foreach($moves as $old => $new) {
|
||||
if (is_dir($old)) {
|
||||
|
|
|
@ -127,13 +127,13 @@ class ShellDispatcher {
|
|||
define('APP_PATH', $this->params['working'] . DS);
|
||||
define('WWW_ROOT', APP_PATH . $this->params['webroot'] . DS);
|
||||
if (!is_dir(ROOT . DS . APP_DIR . DS . 'tmp')) {
|
||||
define('TMP', CAKE_CORE_INCLUDE_PATH . DS . 'Cake' . DS . 'Console' . DS . 'templates' . DS . 'skel' . DS . 'tmp' . DS);
|
||||
define('TMP', CAKE_CORE_INCLUDE_PATH . DS . 'Cake' . DS . 'Console' . DS . 'Templates' . DS . 'skel' . DS . 'tmp' . DS);
|
||||
}
|
||||
$boot = file_exists(ROOT . DS . APP_DIR . DS . 'Config' . DS . 'bootstrap.php');
|
||||
require CORE_PATH . 'Cake' . DS . 'bootstrap.php';
|
||||
|
||||
if (!file_exists(APP_PATH . 'Config' . DS . 'core.php')) {
|
||||
include_once CAKE_CORE_INCLUDE_PATH . DS . 'Cake' . DS . 'Console' . DS . 'templates' . DS . 'skel' . DS . 'Config' . DS . 'core.php';
|
||||
include_once CAKE_CORE_INCLUDE_PATH . DS . 'Cake' . DS . 'Console' . DS . 'Templates' . DS . 'skel' . DS . 'Config' . DS . 'core.php';
|
||||
App::build();
|
||||
}
|
||||
require_once CAKE . 'Console' . DS . 'ConsoleErrorHandler.php';
|
||||
|
|
Before Width: | Height: | Size: 372 B After Width: | Height: | Size: 372 B |
Before Width: | Height: | Size: 943 B After Width: | Height: | Size: 943 B |
Before Width: | Height: | Size: 201 B After Width: | Height: | Size: 201 B |
Loading…
Reference in a new issue