Skip to content

Commit

Permalink
Camelized templates folder.
Browse files Browse the repository at this point in the history
  • Loading branch information
jrbasso committed May 31, 2011
1 parent 192812e commit 2134816
Show file tree
Hide file tree
Showing 77 changed files with 14 additions and 15 deletions.
10 changes: 5 additions & 5 deletions lib/Cake/Console/Command/Task/ProjectTask.php
Expand Up @@ -140,7 +140,7 @@ public function bake($path, $skel = null, $skip = array('empty')) {
$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.'));
Expand All @@ -149,7 +149,7 @@ public function bake($path, $skel = null, $skip = array('empty')) {
$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'
);
}
}
Expand Down Expand Up @@ -203,7 +203,7 @@ public function bake($path, $skel = null, $skip = array('empty')) {
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);
}
Expand Down Expand Up @@ -388,8 +388,8 @@ public function getOptionParser() {
))->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.')
));
}

Expand Down
13 changes: 6 additions & 7 deletions lib/Cake/Console/Command/Task/TemplateTask.php
Expand Up @@ -49,7 +49,7 @@ public function initialize() {
/**
* 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.
*/
Expand All @@ -59,15 +59,14 @@ protected function _findThemes() {
$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;

Expand All @@ -78,18 +77,18 @@ protected function _findThemes() {

$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;
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Console/Command/UpgradeShell.php
Expand Up @@ -88,7 +88,7 @@ public function locations() {

$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)) {
Expand Down
4 changes: 2 additions & 2 deletions lib/Cake/Console/ShellDispatcher.php
Expand Up @@ -127,13 +127,13 @@ function __bootstrap() {
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';
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 2134816

Please sign in to comment.