Udating template home.ctp and providing a default skel dir in tamplate task

This commit is contained in:
Jose Lorenzo Rodriguez 2011-03-15 23:48:51 -04:00
parent a1f5fe706a
commit 8213160bb1
5 changed files with 45 additions and 41 deletions

View file

@ -75,6 +75,6 @@
return;
}
require LIBS . 'Routing' . DS .'Dispatcher.php';
App::uses('Dispatcher', 'Routing');
$Dispatcher = new Dispatcher();
$Dispatcher->dispatch(new CakeRequest());

View file

@ -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.')
));
}

View file

@ -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;
@ -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";

View file

@ -49,7 +49,7 @@
*
*/
if (!defined('CAKE_CORE_INCLUDE_PATH')) {
define('CAKE_CORE_INCLUDE_PATH', ROOT);
define('CAKE_CORE_INCLUDE_PATH', ROOT . DS . 'lib');
}
/**
@ -67,7 +67,7 @@
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);
}
@ -75,6 +75,6 @@
return;
}
require LIBS . 'dispatcher.php';
require LIBS . 'Routing' . DS .'Dispatcher.php';
$Dispatcher = new Dispatcher();
$Dispatcher->dispatch(new CakeRequest());

View file

@ -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>
@ -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');
@ -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