From 8213160bb117ad4f5f4935f9898380801f04e1c9 Mon Sep 17 00:00:00 2001 From: Jose Lorenzo Rodriguez Date: Tue, 15 Mar 2011 23:48:51 -0400 Subject: [PATCH] Udating template home.ctp and providing a default skel dir in tamplate task --- app/webroot/index.php | 2 +- lib/Cake/Console/Command/Task/ProjectTask.php | 9 +--- .../Console/templates/default/views/home.ctp | 47 ++++++++++++------- .../Console/templates/skel/webroot/index.php | 6 +-- lib/Cake/View/pages/home.ctp | 22 ++++----- 5 files changed, 45 insertions(+), 41 deletions(-) diff --git a/app/webroot/index.php b/app/webroot/index.php index 77b9db786..3c5e71589 100644 --- a/app/webroot/index.php +++ b/app/webroot/index.php @@ -75,6 +75,6 @@ return; } - require LIBS . 'Routing' . DS .'Dispatcher.php'; + App::uses('Dispatcher', 'Routing'); $Dispatcher = new Dispatcher(); $Dispatcher->dispatch(new CakeRequest()); diff --git a/lib/Cake/Console/Command/Task/ProjectTask.php b/lib/Cake/Console/Command/Task/ProjectTask.php index addf35a00..19bd4ac01 100644 --- a/lib/Cake/Console/Command/Task/ProjectTask.php +++ b/lib/Cake/Console/Command/Task/ProjectTask.php @@ -52,14 +52,6 @@ class ProjectTask extends Shell { $project = $_SERVER['PWD'] . DS . $project; } - if (empty($this->params['skel'])) { - $core = App::core('Console'); - $skelPath = dirname($core[0]) . DS . 'templates' . DS . 'skel'; - if (is_dir($skelPath) === true) { - $this->params['skel'] = $skelPath; - } - } - while (!$project) { $prompt = __("What is the full path for this app including the app directory name?\n Example:"); $default = APP_PATH . 'myapp'; @@ -387,6 +379,7 @@ class ProjectTask extends Shell { ))->addOption('empty', array( 'help' => __('Create empty files in each of the directories. Good if you are using git') ))->addOption('skel', array( + 'default' => current(App::core('Console')) . DS . 'templates' . DS . 'skel', 'help' => __('The directory layout to use for the new application skeleton. Defaults to cake/console/templates/skel of CakePHP used to create the project.') )); } diff --git a/lib/Cake/Console/templates/default/views/home.ctp b/lib/Cake/Console/templates/default/views/home.ctp index 22217b2fb..b707e5eb3 100644 --- a/lib/Cake/Console/templates/default/views/home.ctp +++ b/lib/Cake/Console/templates/default/views/home.ctp @@ -2,7 +2,7 @@ $output = "

Sweet, \"" . Inflector::humanize($app) . "\" got Baked by CakePHP!

\n"; $output .=" 0): Debugger::checkSecurityKeys(); endif; @@ -52,27 +52,38 @@ endif; ?>

getDataSource('default'); ?>

+ isConnected()): + echo ''; + echo __('Cake is able to connect to the database.'); + echo ''; + else: + echo ''; + echo __('Cake is NOT able to connect to the database.'); + echo ''; + endif; + ?> +

+ isConnected()): - echo ''; - echo __('Cake is able to connect to the database.'); - echo ''; - else: - echo ''; - echo __('Cake is NOT able to connect to the database.'); - echo ''; - endif; -?> -

\n"; -$output .= "\n"; + App::uses('Validation', 'Utility'); + if (!Validation::alphaNumeric('cakephp')) { + echo '

'; + __('PCRE has not been compiled with Unicode support.'); + echo '
'; + __('Recompile PCRE with Unicode support by adding --enable-unicode-properties when configuring'); + echo '

'; + } +?>\n"; $output .= "

\n"; $output .= "

\n"; $output .= "dispatch(new CakeRequest()); diff --git a/lib/Cake/View/pages/home.ctp b/lib/Cake/View/pages/home.ctp index 4c51432de..96aa8dfad 100644 --- a/lib/Cake/View/pages/home.ctp +++ b/lib/Cake/View/pages/home.ctp @@ -18,7 +18,7 @@ if (Configure::read('debug') == 0): throw new NotFoundException(); endif; -App::import('Core', 'Debugger'); +App::uses('Debugger', 'Utility'); ?>

@@ -71,16 +71,6 @@ endif; endif; ?>

-'; - __('PCRE has not been compiled with Unicode support.'); - echo '
'; - __('Recompile PCRE with Unicode support by adding --enable-unicode-properties when configuring'); - echo '

'; - } -?>

+'; + __('PCRE has not been compiled with Unicode support.'); + echo '
'; + __('Recompile PCRE with Unicode support by adding --enable-unicode-properties when configuring'); + echo '

'; + } +?>