Skip to content

Commit

Permalink
Udating template home.ctp and providing a default skel dir in tamplat…
Browse files Browse the repository at this point in the history
…e task
  • Loading branch information
lorenzo committed Mar 16, 2011
1 parent a1f5fe7 commit 8213160
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 41 deletions.
2 changes: 1 addition & 1 deletion app/webroot/index.php
Expand Up @@ -75,6 +75,6 @@
return;
}

require LIBS . 'Routing' . DS .'Dispatcher.php';
App::uses('Dispatcher', 'Routing');
$Dispatcher = new Dispatcher();
$Dispatcher->dispatch(new CakeRequest());
9 changes: 1 addition & 8 deletions lib/Cake/Console/Command/Task/ProjectTask.php
Expand Up @@ -52,14 +52,6 @@ public function execute() {
$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';
Expand Down Expand Up @@ -387,6 +379,7 @@ public function getOptionParser() {
))->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.')
));
}
Expand Down
47 changes: 29 additions & 18 deletions lib/Cake/Console/templates/default/views/home.ctp
Expand Up @@ -2,7 +2,7 @@
$output = "<h2>Sweet, \"" . Inflector::humanize($app) . "\" got Baked by CakePHP!</h2>\n";
$output .="
<?php
App::import('Core', 'Debugger');
App::uses('Debugger', 'Utility');
if (Configure::read() > 0):
Debugger::checkSecurityKeys();
endif;
Expand Down Expand Up @@ -52,27 +52,38 @@ endif;
?>
</p>
<?php
if (!empty(\$filePresent)):
if (!class_exists('ConnectionManager')) {
require LIBS . 'model' . DS . 'connection_manager.php';
if (isset(\$filePresent)):
App::uses('ConnectionManager', 'Model');
try {
\$connected = ConnectionManager::getDataSource('default');
} catch (Exception \$e) {
\$connected = false;
}
\$db = ConnectionManager::getInstance();
\$connected = \$db->getDataSource('default');
?>
<p>
<?php
if (\$connected && \$connected->isConnected()):
echo '<span class=\"notice success\">';
echo __('Cake is able to connect to the database.');
echo '</span>';
else:
echo '<span class=\"notice\">';
echo __('Cake is NOT able to connect to the database.');
echo '</span>';
endif;
?>
</p>
<?php endif;?>
<?php
if (\$connected->isConnected()):
echo '<span class=\"notice success\">';
echo __('Cake is able to connect to the database.');
echo '</span>';
else:
echo '<span class=\"notice\">';
echo __('Cake is NOT able to connect to the database.');
echo '</span>';
endif;
?>
</p>\n";
$output .= "<?php endif;?>\n";
App::uses('Validation', 'Utility');
if (!Validation::alphaNumeric('cakephp')) {
echo '<p><span class=\"notice\">';
__('PCRE has not been compiled with Unicode support.');
echo '<br/>';
__('Recompile PCRE with Unicode support by adding <code>--enable-unicode-properties</code> when configuring');
echo '</span></p>';
}
?>\n";
$output .= "<h3><?php echo __('Editing this Page') ?></h3>\n";
$output .= "<p>\n";
$output .= "<?php\n";
Expand Down
6 changes: 3 additions & 3 deletions lib/Cake/Console/templates/skel/webroot/index.php
Expand Up @@ -49,7 +49,7 @@
*
*/
if (!defined('CAKE_CORE_INCLUDE_PATH')) {
define('CAKE_CORE_INCLUDE_PATH', ROOT);
define('CAKE_CORE_INCLUDE_PATH', ROOT . DS . 'lib');
}

/**
Expand All @@ -67,14 +67,14 @@
define('APP_PATH', ROOT . DS . APP_DIR . DS);
define('CORE_PATH', CAKE_CORE_INCLUDE_PATH . DS);
}
if (!include(CORE_PATH . 'cake' . DS . 'bootstrap.php')) {
if (!include(CORE_PATH . 'Cake' . DS . 'bootstrap.php')) {
trigger_error("CakePHP core could not be found. Check the value of CAKE_CORE_INCLUDE_PATH in APP/webroot/index.php. It should point to the directory containing your " . DS . "cake core directory and your " . DS . "vendors root directory.", E_USER_ERROR);
}

if (isset($_SERVER['PATH_INFO']) && $_SERVER['PATH_INFO'] == '/favicon.ico') {
return;
}

require LIBS . 'dispatcher.php';
require LIBS . 'Routing' . DS .'Dispatcher.php';
$Dispatcher = new Dispatcher();
$Dispatcher->dispatch(new CakeRequest());
22 changes: 11 additions & 11 deletions lib/Cake/View/pages/home.ctp
Expand Up @@ -18,7 +18,7 @@
if (Configure::read('debug') == 0):
throw new NotFoundException();
endif;
App::import('Core', 'Debugger');
App::uses('Debugger', 'Utility');
?>
<h2><?php echo __('Release Notes for CakePHP %s.', Configure::version()); ?></h2>
<a href="http://cakephp.org/changelogs/1.3.6"><?php __('Read the changelog'); ?> </a>
Expand Down Expand Up @@ -71,16 +71,6 @@ endif;
endif;
?>
</p>
<?php
App::uses('Validation', 'Utility');
if (!Validation::alphaNumeric('cakephp')) {
echo '<p><span class="notice">';
__('PCRE has not been compiled with Unicode support.');
echo '<br/>';
__('Recompile PCRE with Unicode support by adding <code>--enable-unicode-properties</code> when configuring');
echo '</span></p>';
}
?>
<?php
if (isset($filePresent)):
App::uses('ConnectionManager', 'Model');
Expand All @@ -104,6 +94,16 @@ if (isset($filePresent)):
?>
</p>
<?php endif;?>
<?php
App::uses('Validation', 'Utility');
if (!Validation::alphaNumeric('cakephp')) {
echo '<p><span class="notice">';
__('PCRE has not been compiled with Unicode support.');
echo '<br/>';
__('Recompile PCRE with Unicode support by adding <code>--enable-unicode-properties</code> when configuring');
echo '</span></p>';
}
?>
<h3><?php echo __('Editing this Page'); ?></h3>
<p>
<?php
Expand Down

0 comments on commit 8213160

Please sign in to comment.