updating error handling: messages, templates and css, updating home page messages

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5943 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
gwoo 2007-11-04 07:03:57 +00:00
parent 73d873acaa
commit 5ccea91b91
23 changed files with 547 additions and 323 deletions

View file

@ -1,3 +1,28 @@
/* SVN FILE: $Id$ */
/**
*
* PHP versions 4 and 5
*
* CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/>
* Copyright 2005-2007, Cake Software Foundation, Inc.
* 1785 E. Sahara Avenue, Suite 490-204
* Las Vegas, Nevada 89104
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @copyright Copyright 2005-2007, Cake Software Foundation, Inc.
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
* @package cake
* @subpackage cake.app.webroot.css
* @since CakePHP(tm)
* @version $Revision$
* @modifiedby $LastChangedBy$
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
* {
margin:0;
padding:0;
@ -6,9 +31,9 @@ padding:0;
/* General Style Info */
body {
background-color: #003d4c;
color: #333;
color: #fff;
font-family:'lucida grande',verdana,helvetica,arial,sans-serif;
font-size:13px;
font-size:90%;
margin: 0;
}
a {
@ -31,24 +56,24 @@ h1, h2, h3, h4 {
}
h1 {
color: #003d4c;
font-size: 130%;
font-size: 100%;
margin: 0.1em 0;
}
h2 {
color: #e32;
font-family:'Gill Sans','lucida grande',helvetica, arial, sans-serif;
font-size: 160%;
font-size: 190%;
margin: 0.3em 0;
padding-top: 1em;
padding-top: 0.8em;
}
h3 {
color: #c6c65b;
color: #993;
font-family:'Gill Sans','lucida grande',helvetica, arial, sans-serif;
font-size: 150%;
padding-top: 2em;
font-size: 165%;
padding-top: 1.5em;
}
h4 {
color: #c6c65b;
color: #993;
font-weight: normal;
padding-top: 0.5em;
}
@ -67,7 +92,6 @@ ul, li {
#header h1 {
background: url('../img/cake.icon.gif') no-repeat left;
color: #ffffff;
font-size: 110%;
padding: 0px 30px;
}
#header h1 a {
@ -85,7 +109,7 @@ ul, li {
background-color: #fff;
clear: both;
color: #333;
padding: 0px 40px 40px 40px;
padding: 10px 20px 40px 20px;
overflow: auto;
}
#footer {
@ -113,19 +137,16 @@ th {
border-bottom: 1px solid #bbb;
text-align: center;
}
th a {
display: block;
padding: 2px 4px;
text-decoration: none;
}
th a:hover {
background-color: #ccc;
color: #333;
text-decoration: none;
}
table tr td {
background: #fff;
border-right: 1px solid #ccc;
@ -187,7 +208,7 @@ form {
clear: both;
margin-right: 20px;
padding: 0;
width: 60%;
width: 80%;
}
fieldset {
border: 1px solid #ccc;
@ -274,30 +295,36 @@ div.error-message {
color: #900;
font-weight: bold;
}
div.error em {
font-size: 140%;
color: #003d4c;
}
span.notice {
background-color: #c6c65b;
p.error {
background-color: #e32;
color: #fff;
display: block;
font-size: 140%;
padding: 0.5em;
font-family: Courier, monospace;
font-size: 120%;
line-height: 140%;
padding: 0.8em;
margin: 1em 0;
}
p.error em {
color: #000;
font-weight: normal;
line-height: 140%;
}
.notice {
background-color: #ffcc00;
color: #000;
display: block;
font-family: Courier, monospace;
font-size: 120%;
line-height: 140%;
padding: 0.8em;
margin: 1em 0;
}
.success {
background-color: green;
color: #FFF;
}
/* Actions */
div.index div.actions {
clear: both;
margin-top: .4em;
text-align: left;
}
div.view div.actions {
clear: both;
margin-top: .4em;
text-align: left;
width: 60%;
}
div.actions ul {
margin: 0px 0;
padding: 0;
@ -330,22 +357,23 @@ pre {
background: #f0f0f0;
padding: 1em;
}
pre.cake-debug {
background: #ffcc00;
font-size: 120%;
line-height: 18px;
margin: 4px 2px;
line-height: 140%;
margin-top: 1em;
overflow: auto;
position: relative;
white-space: normal;
}
div.cake-stack-trace {
background: #fff;
border: 4px dotted #ffcc00;
color: #333;
margin: 4px 2px;
padding: 4px;
margin: 0px;
padding: 6px;
font-size: 120%;
line-height: 18px;
line-height: 140%;
overflow: auto;
position: relative;
}
@ -356,19 +384,19 @@ div.cake-code-dump pre {
div.cake-stack-trace pre, div.cake-code-dump pre {
color: #000000;
background-color: #F0F0F0;
border: 1px dotted #606060;
margin: 4px 2px;
padding: 4px;
margin: 0px;
padding: 1em;
overflow: auto;
}
div.cake-code-dump pre, div.cake-code-dump pre code {
clear: both;
font-size: 12px;
line-height: 5px;
line-height: 7px;
margin: 4px 2px;
padding: 4px;
overflow: auto;
}
div.cake-code-dump span.code-highlight {
background-color: #FFFF00;
padding: 4px;
}

View file

@ -50,7 +50,7 @@ if (!defined('SERVER_IIS') && php_sapi_name() == 'isapi') {
if(Configure::read('Cache.disable') !== true) {
$cache = Cache::settings();
if(empty($cache)) {
trigger_error('Cache not configured. Please use Cache::config(); in APP/config/core.php', E_USER_WARNING);
trigger_error('Cache not configured properly. Please check Cache::config(); in APP/config/core.php', E_USER_WARNING);
Cache::config('default', array('engine' => 'File'));
}
}

View file

@ -1,3 +1,28 @@
/* SVN FILE: $Id$ */
/**
*
* PHP versions 4 and 5
*
* CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/>
* Copyright 2005-2007, Cake Software Foundation, Inc.
* 1785 E. Sahara Avenue, Suite 490-204
* Las Vegas, Nevada 89104
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @copyright Copyright 2005-2007, Cake Software Foundation, Inc.
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
* @package cake
* @subpackage cake.app.webroot.css
* @since CakePHP(tm)
* @version $Revision$
* @modifiedby $LastChangedBy$
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
* {
margin:0;
padding:0;
@ -6,7 +31,7 @@ padding:0;
/* General Style Info */
body {
background-color: #003d4c;
color: #333;
color: #fff;
font-family:'lucida grande',verdana,helvetica,arial,sans-serif;
font-size:13px;
margin: 0;
@ -37,18 +62,18 @@ h1 {
h2 {
color: #e32;
font-family:'Gill Sans','lucida grande',helvetica, arial, sans-serif;
font-size: 160%;
font-size: 190%;
margin: 0.3em 0;
padding-top: 1em;
padding-top: 0.8em;
}
h3 {
color: #c6c65b;
color: #993;
font-family:'Gill Sans','lucida grande',helvetica, arial, sans-serif;
font-size: 150%;
padding-top: 2em;
font-size: 165%;
padding-top: 1.5em;
}
h4 {
color: #c6c65b;
color: #993;
font-weight: normal;
padding-top: 0.5em;
}
@ -85,7 +110,7 @@ ul, li {
background-color: #fff;
clear: both;
color: #333;
padding: 0px 40px 40px 40px;
padding: 10px 20px 40px 20px;
overflow: auto;
}
#footer {
@ -113,19 +138,16 @@ th {
border-bottom: 1px solid #bbb;
text-align: center;
}
th a {
display: block;
padding: 2px 4px;
text-decoration: none;
}
th a:hover {
background-color: #ccc;
color: #333;
text-decoration: none;
}
table tr td {
background: #fff;
border-right: 1px solid #ccc;
@ -187,7 +209,7 @@ form {
clear: both;
margin-right: 20px;
padding: 0;
width: 60%;
width: 80%;
}
fieldset {
border: 1px solid #ccc;
@ -274,30 +296,35 @@ div.error-message {
color: #900;
font-weight: bold;
}
div.error em {
font-size: 140%;
color: #003d4c;
}
span.notice {
background-color: #c6c65b;
p.error {
background-color: #e32;
color: #fff;
display: block;
font-size: 140%;
padding: 0.5em;
font-family: Courier, monospace;
font-size: 120%;
line-height: 140%;
padding: 0.8em;
margin: 1em 0;
}
p.error em {
color: #000;
font-weight: normal;
}
.notice {
background-color: #ffcc00;
color: #000;
display: block;
font-family: Courier, monospace;
font-size: 120%;
line-height: 140%;
padding: 0.8em;
margin: 1em 0;
}
.success {
background-color: green;
color: #FFF;
}
/* Actions */
div.index div.actions {
clear: both;
margin-top: .4em;
text-align: left;
}
div.view div.actions {
clear: both;
margin-top: .4em;
text-align: left;
width: 60%;
}
div.actions ul {
margin: 0px 0;
padding: 0;
@ -330,22 +357,23 @@ pre {
background: #f0f0f0;
padding: 1em;
}
pre.cake-debug {
background: #ffcc00;
font-size: 120%;
line-height: 18px;
margin: 4px 2px;
line-height: 140%;
margin-top: 1em;
overflow: auto;
position: relative;
white-space: normal;
}
div.cake-stack-trace {
background: #fff;
border: 4px dotted #ffcc00;
color: #333;
margin: 4px 2px;
padding: 4px;
margin: 0px;
padding: 6px;
font-size: 120%;
line-height: 18px;
line-height: 140%;
overflow: auto;
position: relative;
}
@ -356,19 +384,19 @@ div.cake-code-dump pre {
div.cake-stack-trace pre, div.cake-code-dump pre {
color: #000000;
background-color: #F0F0F0;
border: 1px dotted #606060;
margin: 4px 2px;
padding: 4px;
margin: 0px;
padding: 1em;
overflow: auto;
}
div.cake-code-dump pre, div.cake-code-dump pre code {
clear: both;
font-size: 12px;
line-height: 5px;
line-height: 7px;
margin: 4px 2px;
padding: 4px;
overflow: auto;
}
div.cake-code-dump span.code-highlight {
background-color: #FFFF00;
padding: 4px;
}

View file

@ -7,58 +7,52 @@ if(Configure::read() > 0):
endif;
?>
<p>
<span class=\"notice\">
<?php
if (is_writable(TMP)):
echo '<span class=\"notice success\">';
__('Your tmp directory is writable.');
echo '</span>';
else:
echo '<span class=\"notice\">';
__('Your tmp directory is NOT writable.');
echo '</span>';
endif;
?>
</span>
</p>
<p>
<span class=\"notice\">
<?php
if (Cache::isInitialized()):
__('Your cache is set up and initialized properly.');
\$settings = Cache::settings();
if (!empty(\$settings)):
echo '<div class=\"notice success\">';
echo '<p>';
echo sprintf(__('%s is being used to cache, to change this edit config'.DS.'core.php ', true), \$settings['engine'] . 'Engine');
echo sprintf(__('The %s is being used for caching. To change the config edit APP/config/core.php ', true), '<em>'. \$settings['engine'] . 'Engine</em>');
echo '</p>';
echo 'Settings: <ul>';
foreach (\$settings as \$name => \$value):
echo '<li>' . \$name . ': ' . \$value . '</li>';
endforeach;
echo '</ul>';
echo '</div>';
else:
__('Your cache is NOT working.');
echo '<br />';
if (is_writable(TMP . 'cache')):
__('Edit: config'.DS.'core.php to insure you have the newset version of this file and the variable \$cakeCache set properly');
else:
__('Your cache directory is not writable');
endif;
echo '<div class=\"notice\">';
echo '<p>';
__('Your cache is NOT working. Please check the settings in APP/config/core.php');
echo '</p>';
echo '</div>';
endif;
?>
</span>
</p>
<p>
<span class=\"notice\">
<?php
\$filePresent = null;
if (file_exists(CONFIGS . 'database.php')):
echo '<span class=\"notice success\">';
__('Your database configuration file is present.');
\$filePresent = true;
echo '</span>';
else:
echo '<span class=\"notice\">';
__('Your database configuration file is NOT present.');
echo '<br/>';
__('Rename config'.DS.'database.php.default to config'.DS.'database.php');
__('Rename config/database.php.default to config/database.php');
echo '</span>';
endif;
?>
</span>
</p>
<?php
if (!empty(\$filePresent)):
@ -67,15 +61,17 @@ if (!empty(\$filePresent)):
\$connected = \$db->getDataSource('default');
?>
<p>
<span class=\"notice\">
<?php
if (\$connected->isConnected()):
echo '<span class=\"notice success\">';
__('Cake is able to connect to the database.');
echo '</span>';
else:
echo '<span class=\"notice\">';
__('Cake is NOT able to connect to the database.');
echo '</span>';
endif;
?>
</span>
</p>\n";
$output .= "<?php endif;?>\n";
$output .= "<h3><?php __('Editing this Page') ?></h3>\n";

View file

@ -139,6 +139,7 @@ class Debugger extends Object {
$level = LOG_WARNING;
break;
case E_NOTICE:
case E_USER_NOTICE:
$error = 'Notice';
$level = LOG_NOTICE;
break;
@ -290,7 +291,7 @@ class Debugger extends Object {
} elseif (strpos($path, APP) === 0) {
$path = r(APP, 'APP' . DS, $path);
} elseif (strpos($path, ROOT) === 0) {
$path = r(ROOT, 'ROOT' . DS, $path);
$path = r(ROOT, 'ROOT', $path);
}
return $path;
}

View file

@ -130,8 +130,8 @@ class ErrorHandler extends Object{
header("HTTP/1.0 404 Not Found");
$this->error(array('code' => '404',
'name' => __('Not found', true),
'message' => sprintf(__("The requested address %s was not found on this server.", true), $url, $message),
'name' => __('Not Found', true),
'message' => sprintf(__("The requested address %s was not found on this server.", true), "<strong>'{$url}'</strong>", $message),
'base' => $base));
exit();
}
@ -168,7 +168,9 @@ class ErrorHandler extends Object{
$this->controller->base = $base;
$this->controller->webroot = $webroot;
$this->controller->viewPath = 'errors';
$controllerName = str_replace('Controller', '', $className);
$this->controller->set(array('controller' => $className,
'controllerName' => $controllerName,
'action' => $action,
'title' => __('Missing Method in Controller', true)));
$this->controller->render('missingAction');

View file

@ -24,5 +24,8 @@
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
?>
<h1><?php echo $name; ?></h1>
<p><?php echo $message; ?></p>
<h2><?php echo $name; ?></h2>
<p class="error">
<strong><?php __('Error'); ?>: </strong>
<?php echo $message; ?>
</p>

View file

@ -24,16 +24,30 @@
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
?>
<h1><?php echo sprintf(__('Missing Method in %s', true), $controller);?></h1>
<p class="error"><?php echo sprintf(__('You are seeing this error because the action <em>%1$s</em> is not defined in controller <em>%2$s</em>', true), $action, $controller);?></p>
<p><span class="notice"><?php echo sprintf(__('If you want to customize this error message, create %s.', true), APP_DIR.DS."views".DS."errors".DS."missing_action.ctp");?></span></p>
<p><span class="notice"><strong><?php __('Fatal') ?>: </strong>
<?php echo sprintf(__('Confirm you have created the %1$s::%2$s in file : %3$s.', true), $controller, $action, APP_DIR.DS."controllers".DS.Inflector::underscore($controller).".php");?></span></p>
<p>&lt;?php<br />
class <?php echo $controller;?> extends AppController {<br />
&nbsp;&nbsp;&nbsp;<strong>function <?php echo $action;?>() {<br />
&nbsp;&nbsp;&nbsp;}</strong><br />
}<br />
?&gt;<br />
<h2><?php echo sprintf(__('Missing Method in %s', true), $controller);?></h2>
<p class="error">
<strong><?php __('Error') ?>: </strong>
<?php echo sprintf(__('The action %1$s is not defined in controller %2$s', true), "<em>".$action."</em>", "<em>".$controller."</em>");?>
</p>
<p class="error">
<strong><?php __('Error') ?>: </strong>
<?php echo sprintf(__('Create %1$s%2$s in file: %3$s.', true), "<em>".$controller."::</em>", "<em>".$action."()</em>", APP_DIR.DS."controllers".DS.Inflector::underscore($controller).".php");?>
</p>
<pre>
&lt;?php
class <?php echo $controller;?> extends AppController {
var $name = '<?php echo $controllerName;?>';
<strong>
function <?php echo $action;?>() {
}
</strong>
}
?&gt;
</pre>
<p class="notice">
<strong><?php __('Notice') ?>: </strong>
<?php echo sprintf(__('If you want to customize this error message, create %s.', true), APP_DIR.DS."views".DS."errors".DS."missing_action.ctp");?>
</p>

View file

@ -24,17 +24,23 @@
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
?>
<h1><?php __('Missing Component Class'); ?></h1>
<h2><?php __('Missing Component Class'); ?></h2>
<p class="error">
<?php echo sprintf(__('You are seeing this error because the component class <em>%1$s</em> you have set in <em>%2$s</em> can\'t be found or doesn\'t exist.', true), $component."Component", $controller."Controller");?>
<strong><?php __('Error'); ?>: </strong>
<?php echo sprintf(__('Component class %1$s in %2$s was not found.', true), "<em>". $component ."Component</em>", "<em>". $controller ."Controller</em>");?>
</p>
<p><span class="notice"><strong><?php __('Notice'); ?>: </strong>
<?php echo sprintf(__('If you want to customize this error message, create %s', true), APP_DIR.DS."views".DS."errors".DS."missing_component_class.ctp");?></span></p>
<p><span class="notice"><strong><?php __('Fatal'); ?>: </strong>
<?php echo sprintf(__('Create the class below in file: %s', true), APP_DIR.DS."controllers".DS."components".DS.$file);?></span></p>
<p>&lt;?php<br />
<p class="error">
<strong><?php __('Error'); ?>: </strong>
<?php echo sprintf(__('Create the class %s in file: %s', true), "<em>". $component ."Component</em>", APP_DIR.DS."controllers".DS."components".DS.$file);?>
</p>
<pre>
&lt;?php
class <?php echo $component;?>Component extends Object {<br />
}<br />
?&gt;<br />
}
?&gt;
</pre>
<p class="notice">
<strong><?php __('Notice'); ?>: </strong>
<?php echo sprintf(__('If you want to customize this error message, create %s', true), APP_DIR.DS."views".DS."errors".DS."missing_component_class.ctp");?>
</p>

View file

@ -24,14 +24,23 @@
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
?>
<h1><?php __('Missing Component File'); ?></h1>
<p class="error"><?php __("You are seeing this error because the component file can not be found or does not exist."); ?></p>
<p><span class="notice"><strong><?php __('Notice'); ?>: </strong>
<?php echo sprintf(__('If you want to customize this error message, create %s', true), APP_DIR.DS."views".DS."errors".DS."missing_component_file.ctp");?></span></p>
<p><span class="notice"><strong><?php __('Fatal'); ?>: </strong>
<?php echo sprintf(__('Create the class below in file: %s', true), APP_DIR.DS."controllers".DS."components".DS.$file);?></span></p>
<p>&lt;?php<br />
<h2><?php __('Missing Component File'); ?></h2>
<p class="error">
<strong><?php __('Error'); ?>: </strong>
<?php __("The component file was not found."); ?>
</p>
<p class="error">
<strong><?php __('Error'); ?>: </strong>
<?php echo sprintf(__('Create the class %s in file: %s', true), "<em>". $component ."Component</em>", APP_DIR.DS."controllers".DS."components".DS.$file);?>
</p>
<pre>
&lt;?php
class <?php echo $component;?>Component extends Object {<br />
}<br />
?&gt;<br /> </p>
}
?&gt;
</pre>
<p class="notice">
<strong><?php __('Notice'); ?>: </strong>
<?php echo sprintf(__('If you want to customize this error message, create %s', true), APP_DIR.DS."views".DS."errors".DS."missing_component_file.ctp");?>
</p>

View file

@ -24,10 +24,16 @@
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
?>
<h1><?php __('Requires a Database Connection'); ?></h1>
<h2><?php __('Missing Database Connection'); ?></h2>
<p class="error">
<strong><?php __('Error'); ?>: </strong>
<?php echo sprintf(__('%s requires a database connection', true), $model);?>
</p>
<p class="error">
<strong><?php __('Error'); ?>: </strong>
<?php echo sprintf(__('Confirm you have created the file : %s.', true), APP_DIR.DS."config".DS."database.php");?>
<p class="error"><?php echo sprintf(__('Missing Database Connection: %s requires a database connection', true), $model);?></p>
<p><span class="notice"><strong><?php __('Notice'); ?>: </strong>
<?php echo sprintf(__('If you want to customize this error message, create %s.', true), APP_DIR.DS."views".DS."errors".DS."missing_database.ctp");?></span></p>
<p><span class="notice"><strong><?php __('Fatal'); ?>: </strong>
<?php echo sprintf(__('Confirm you have created the file : %s.', true), APP_DIR.DS."config".DS."database.php");?></span></p>
</p>
<p class="notice">
<strong><?php __('Notice'); ?>: </strong>
<?php echo sprintf(__('If you want to customize this error message, create %s.', true), APP_DIR.DS."views".DS."errors".DS."missing_database.ctp");?>
</p>

View file

@ -24,16 +24,24 @@
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
?>
<h1><?php __('Missing controller'); ?></h1>
<p class="error"><?php echo sprintf(__('You are seeing this error because controller <em>%s</em> could not be found.', true), $controller);?></p>
<p><span class="notice"><strong><?php __('Notice'); ?>: </strong>
<?php echo sprintf(__('If you want to customize this error message, create %s', true), APP_DIR.DS."views".DS."errors".DS."missing_controller.ctp");?></span></p>
<p><span class="notice"><strong><?php __('Fatal'); ?>: </strong>
<?php echo sprintf(__('Create the class below in file: %s', true), APP_DIR.DS."controllers".DS.Inflector::underscore($controller).".php");?></span></p>
<p>&lt;?php<br />
class <?php echo $controller;?> extends AppController {<br />
&nbsp;&nbsp;&nbsp;var $name = '<?php echo $controllerName;?>';<br />
}<br />
?&gt;<br />
<h2><?php __('Missing Controller'); ?></h2>
<p class="error">
<strong><?php __('Error'); ?>: </strong>
<?php echo sprintf(__('%s could not be found.', true), "<em>".$controller."</em>");?>
</p>
<p class="error">
<strong><?php __('Error'); ?>: </strong>
<?php echo sprintf(__('Create the class %s below in file: %s', true), "<em>".$controller."</em>", APP_DIR.DS."controllers".DS.Inflector::underscore($controller).".php");?>
</p>
<pre>
&lt;?php
class <?php echo $controller;?> extends AppController {
var $name = '<?php echo $controllerName;?>';
}
?&gt;
</pre>
<p class="notice">
<strong><?php __('Notice'); ?>: </strong>
<?php echo sprintf(__('If you want to customize this error message, create %s', true), APP_DIR.DS."views".DS."errors".DS."missing_controller.ctp");?>
</p>

View file

@ -24,14 +24,23 @@
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
?>
<h1><?php __('Missing Helper Class'); ?></h1>
<p class="error"><?php echo sprintf(__("You are seeing this error because the view helper class <em>%s</em> can not be found or does not exist.", true), $helperClass);?></p>
<p><span class="notice"><strong><?php __('Notice'); ?>: </strong>
<?php echo sprintf(__('If you want to customize this error message, create %s', true), APP_DIR.DS."views".DS."errors".DS."missing_helper_class.ctp");?></span></p>
<p><span class="notice"><strong><?php __('Fatal'); ?>: </strong>
<?php echo sprintf(__('Create the class below in file: %s', true), APP_DIR.DS."views".DS."helpers".DS.$file);?></span></p>
<p>&lt;?php<br />
class <?php echo $helperClass;?> extends Helper {<br />
}<br />
?&gt;<br />
<h2><?php __('Missing Helper Class'); ?></h2>
<p class="error">
<strong><?php __('Error'); ?>: </strong>
<?php echo sprintf(__("The helper class <em>%s</em> can not be found or does not exist.", true), $helperClass);?>
</p>
<p class="error">
<strong><?php __('Error'); ?>: </strong>
<?php echo sprintf(__('Create the class below in file: %s', true), APP_DIR.DS."views".DS."helpers".DS.$file);?>
</p>
<pre>
&lt;?php
class <?php echo $helperClass;?> extends AppHelper {
}
?&gt;
</pre>
<p class="notice">
<strong><?php __('Notice'); ?>: </strong>
<?php echo sprintf(__('If you want to customize this error message, create %s', true), APP_DIR.DS."views".DS."errors".DS."missing_helper_class.ctp");?>
</p>

View file

@ -24,14 +24,23 @@
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
?>
<h1><?php __('Missing Helper File'); ?></h1>
<p class="error"><?php echo sprintf(__("You are seeing this error because the view helper file %s can not be found or does not exist.", true), APP_DIR.DS."views".DS."helpers".DS.$file);?></p>
<p><span class="notice"><strong><?php __('Notice'); ?>: </strong>
<?php echo sprintf(__('If you want to customize this error message, create %s', true), APP_DIR.DS."views".DS."errors".DS."missing_helper_file.ctp");?></span></p>
<p><span class="notice"><strong><?php __('Fatal'); ?>: </strong>
<?php echo sprintf(__('Create the class below in file: %s', true), APP_DIR.DS."views".DS."helpers".DS.$file);?></span></p>
<p>&lt;?php<br />
class <?php echo $helperClass;?> extends Helper {<br />
}<br />
?&gt;<br />
<h2><?php __('Missing Helper File'); ?></h2>
<p class="error">
<strong><?php __('Error'); ?>: </strong>
<?php echo sprintf(__("The helper file %s can not be found or does not exist.", true), APP_DIR.DS."views".DS."helpers".DS.$file);?>
</p>
<p class="error">
<strong><?php __('Error'); ?>: </strong>
<?php echo sprintf(__('Create the class below in file: %s', true), APP_DIR.DS."views".DS."helpers".DS.$file);?>
</p>
<pre>
&lt;?php
class <?php echo $helperClass;?> extends AppHelper {
}
?&gt;
</pre>
<p class="notice">
<strong><?php __('Notice'); ?>: </strong>
<?php echo sprintf(__('If you want to customize this error message, create %s', true), APP_DIR.DS."views".DS."errors".DS."missing_helper_file.ctp");?>
</p>

View file

@ -24,9 +24,16 @@
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
?>
<h1><?php __('Missing Layout'); ?></h1>
<p class="error"><?php echo sprintf(__("You are seeing this error because the layout file %s can not be found or does not exist.", true), $file);?></p>
<p><span class="notice"><strong><?php __('Notice'); ?>: </strong>
<?php echo sprintf(__('If you want to customize this error message, create %s', true), APP_DIR.DS."views".DS."errors".DS."missing_layout.ctp");?></span></p>
<p><span class="notice"><strong><?php __('Fatal'); ?>: </strong>
<?php echo sprintf(__('Confirm you have created the file: %s', true), $file);?></span></p>
<h2><?php __('Missing Layout'); ?></h2>
<p class="error">
<strong><?php __('Error'); ?>: </strong>
<?php echo sprintf(__("The layout file %s can not be found or does not exist.", true), "<em>". $file ."</em>");?>
</p>
<p class="error">
<strong><?php __('Error'); ?>: </strong>
<?php echo sprintf(__('Confirm you have created the file: %s', true), "<em>". $file ."</em>");?>
</p>
<p class="notice">
<strong><?php __('Notice'); ?>: </strong>
<?php echo sprintf(__('If you want to customize this error message, create %s', true), APP_DIR.DS."views".DS."errors".DS."missing_layout.ctp");?>
</p>

View file

@ -24,15 +24,25 @@
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
?>
<h1><?php __('Missing Model'); ?></h1>
<p class="error"><?php echo sprintf(__("No class found for the <em>%s</em> model.", true), $model);?></p>
<p><span class="notice"><strong><?php __('Notice'); ?>: </strong>
<?php echo sprintf(__('If you want to customize this error message, create %s', true), APP_DIR.DS."views".DS."errors".DS."missing_model.ctp");?></span></p>
<p><span class="notice"><strong><?php __('Fatal'); ?>: </strong>
<?php echo sprintf(__('Create the class below in file: %s', true), APP_DIR.DS."models".DS.Inflector::underscore($model).".php");?></span></p>
<p>&lt;?php<br />
class <?php echo $model;?> extends AppModel {<br />
&nbsp;&nbsp;&nbsp;var $name = '<?php echo $model;?>';<br />
}<br />
?&gt;<br />
<h2><?php __('Missing Model'); ?></h2>
<p class="error">
<strong><?php __('Error'); ?>: </strong>
<?php echo sprintf(__("<em>%s</em> could not be found.", true), $model);?>
</p>
<p class="error">
<strong><?php __('Error'); ?>: </strong>
<?php echo sprintf(__('Create the class %s in file: %s', true), "<em>". $model . "</em>", APP_DIR.DS."models".DS.Inflector::underscore($model).".php");?>
</p>
<pre>
&lt;?php
class <?php echo $model;?> extends AppModel {
var $name = '<?php echo $model;?>';
}
?&gt;
</pre>
<p class="notice">
<strong><?php __('Notice'); ?>: </strong>
<?php echo sprintf(__('If you want to customize this error message, create %s', true), APP_DIR.DS."views".DS."errors".DS."missing_model.ctp");?>
</p>

View file

@ -24,9 +24,16 @@
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
?>
<h1><?php __('Scaffold Requires a Database Connection'); ?></h1>
<p class="error"><?php __('Missing Database Connection: Scaffold Does not work without a database connection'); ?></p>
<p><span class="notice"><strong><?php __('Notice'); ?>: </strong>
<?php echo sprintf(__('If you want to customize this error message, create %s', true), APP_DIR.DS."views".DS."errors".DS."missing_scaffolddb.ctp");?></span></p>
<p><span class="notice"><strong><?php __('Fatal'); ?>: </strong>
<?php echo sprintf(__('Confirm you have created the file: %s', true), APP_DIR.DS."config".DS."database.php");?></span></p>
<h2><?php __('Missing Database Connection'); ?></h2>
<p class="error">
<strong><?php __('Error'); ?>: </strong>
<?php __('Scaffold requires a database connection'); ?>
</p>
<p class="error">
<strong><?php __('Error'); ?>: </strong>
<?php echo sprintf(__('Confirm you have created the file: %s', true), APP_DIR.DS."config".DS."database.php");?>
</p>
<p class="notice">
<strong><?php __('Notice'); ?>: </strong>
<?php echo sprintf(__('If you want to customize this error message, create %s', true), APP_DIR.DS."views".DS."errors".DS."missing_scaffolddb.ctp");?>
</p>

View file

@ -24,7 +24,12 @@
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
?>
<h1><?php __('Missing Database Table'); ?></h1>
<p class="error"><?php echo sprintf(__('No Database table for model %1$s (expected %2$s), create it first.', true), $model, $table);?></p>
<p><span class="notice"><strong><?php __('Notice'); ?>: </strong>
<?php echo sprintf(__('If you want to customize this error message, create %s', true), APP_DIR.DS."views".DS."errors".DS."missing_table.ctp");?></span></p>
<h2><?php __('Missing Database Table'); ?></h2>
<p class="error">
<strong><?php __('Error'); ?>: </strong>
<?php echo sprintf(__('Database table %1$s for model %2$s was not found.', true),"<em>". $table ."</em>", "<em>". $model ."</em>");?>
</p>
<p class="notice">
<strong><?php __('Notice'); ?>: </strong>
<?php echo sprintf(__('If you want to customize this error message, create %s', true), APP_DIR.DS."views".DS."errors".DS."missing_table.ctp");?>
</p>

View file

@ -24,9 +24,16 @@
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
?>
<h1><?php __('Missing view'); ?></h1>
<p class="error"><?php echo sprintf(__('You are seeing this error because the view for <em>%1$s::%2$s()</em>, could not be found.', true), $controller.'Controller', $action);?></p>
<p><span class="notice"><strong><?php __('Notice'); ?>: </strong>
<?php echo sprintf(__('If you want to customize this error message, create %s', true), APP_DIR.DS."views".DS."errors".DS."missing_view.ctp");?></span></p>
<p><span class="notice"><strong><?php __('Fatal'); ?>: </strong>
<?php echo sprintf(__('Confirm you have created the file: %s', true), $file);?></span></p>
<h2><?php __('Missing View'); ?></h2>
<p class="error">
<strong><?php __('Error'); ?>: </strong>
<?php echo sprintf(__('The view for %1$s%2$s was not found.', true), "<em>". $controller."Controller::</em>", "<em>". $action ."()</em>");?>
</p>
<p class="error">
<strong><?php __('Error'); ?>: </strong>
<?php echo sprintf(__('Confirm you have created the file: %s', true), $file);?>
</p>
<p class="notice">
<strong><?php __('Notice'); ?>: </strong>
<?php echo sprintf(__('If you want to customize this error message, create %s', true), APP_DIR.DS."views".DS."errors".DS."missing_view.ctp");?>
</p>

View file

@ -24,7 +24,12 @@
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
?>
<h1><?php echo sprintf(__('Private Method in %s', true), $controller);?></h1>
<p class="error"><?php echo sprintf(__("You are seeing this error because the private class method <em>%s</em> should not be accessed directly.", true), $action);?></p>
<p><span class="notice"><strong><?php __('Notice'); ?>: </strong>
<?php echo sprintf(__('If you want to customize this error message, create %s', true), APP_DIR.DS."views".DS."errors".DS."private_action.ctp");?></span></p>
<h2><?php echo sprintf(__('Private Method in %s', true), $controller);?></h2>
<p class="error">
<strong><?php __('Error'); ?>: </strong>
<?php echo sprintf(__("%s%s cannot be accessed directly.", true), "<em>". $controller ."::</em>", "<em>". $action ."()</em>");?>
</p>
<p class="notice">
<strong><?php __('Notice'); ?>: </strong>
<?php echo sprintf(__('If you want to customize this error message, create %s', true), APP_DIR.DS."views".DS."errors".DS."private_action.ctp");?>
</p>

View file

@ -24,11 +24,19 @@
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
?>
<h1><?php __('Scaffold Error'); ?></h1>
<p class="error"><?php __('Your must implement the following method in your controller'); ?></p>
<p><span class="notice"><strong><?php __('Notice'); ?>: </strong>
<?php echo sprintf(__('If you want to customize this error message, create %s', true), APP_DIR.DS."views".DS."errors".DS."scaffold_error.ctp");?></span></p>
<p>
&nbsp;&nbsp;&nbsp;function _scaffoldError() {<br />
&nbsp;&nbsp;&nbsp;}<br />
<h2><?php __('Scaffold Error'); ?></h2>
<p class="error">
<strong><?php __('Error'); ?>: </strong>
<?php __('Method _scaffoldError in was not found in the controller'); ?>
</p>
<p class="notice">
<strong><?php __('Notice'); ?>: </strong>
<?php echo sprintf(__('If you want to customize this error message, create %s', true), APP_DIR.DS."views".DS."errors".DS."scaffold_error.ctp");?>
</p>
<pre>
&lt;?php
function _scaffoldError() {<br />
}
?&gt;
</pre>

View file

@ -24,99 +24,95 @@
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
?>
<h2><?php echo sprintf(__('Release Notes for CakePHP %s.', true), Configure::version()); ?></h2>
<a href="https://trac.cakephp.org/wiki/notes/1.2.x.x"><?php __('Read the release notes and get the latest version'); ?> </a>
<?php
if(Configure::read() > 0):
Debugger::checkSessionKey();
endif;
?>
<p>
<span class="notice">
<?php
if (is_writable(TMP)):
echo '<span class="notice success">';
__('Your tmp directory is writable.');
echo '</span>';
else:
echo '<span class="notice">';
__('Your tmp directory is NOT writable.');
echo '</span>';
endif;
?>
</span>
</p>
<p>
<span class="notice">
<?php
if (Cache::isInitialized()):
__('Your cache is set up and initialized properly.');
$settings = Cache::settings();
if (!empty($settings)):
echo '<div class="notice success">';
echo '<p>';
echo sprintf(__('%s is being used to cache, to change this edit config/core.php ', true), $settings['engine'] . 'Engine');
echo sprintf(__('The %s is being used for caching. To change the config edit APP/config/core.php ', true), '<em>'. $settings['engine'] . 'Engine</em>');
echo '</p>';
echo 'Settings: <ul>';
foreach ($settings as $name => $value):
echo '<li>' . $name . ': ' . $value . '</li>';
endforeach;
echo '</ul>';
echo '</div>';
else:
__('Your cache is NOT working.');
echo '<br />';
if (is_writable(TMP . 'cache')):
__('Edit: config/core.php to insure you have the newset version of this file and the variable $cakeCache set properly');
else:
__('Your cache directory is not writable');
endif;
echo '<div class="notice">';
echo '<p>';
__('Your cache is NOT working. Please check the settings in APP/config/core.php');
echo '</p>';
echo '</div>';
endif;
?>
</span>
</p>
<p>
<span class="notice">
<?php
$filePresent = null;
if (file_exists(CONFIGS.'database.php')):
echo '<span class="notice success">';
__('Your database configuration file is present.');
$filePresent = true;
echo '</span>';
else:
echo '<span class="notice">';
__('Your database configuration file is NOT present.');
echo '<br/>';
__('Rename config/database.php.default to config/database.php');
echo '</span>';
endif;
?>
</span>
</p>
<?php
if (!empty($filePresent)):
if (isset($filePresent)):
uses('model' . DS . 'connection_manager');
$db = ConnectionManager::getInstance();
$connected = $db->getDataSource('default');
?>
<p>
<span class="notice">
<?php
if ($connected->isConnected()):
echo '<span class="notice success">';
__('Cake is able to connect to the database.');
echo '</span>';
else:
echo '<span class="notice">';
__('Cake is NOT able to connect to the database.');
echo '</span>';
endif;
?>
</span>
</p>
<?php endif;?>
<h2><?php echo sprintf(__('Release Notes for CakePHP %s.', true), Configure::version()); ?></h2>
<a href="https://trac.cakephp.org/wiki/notes/1.2.x.x"><?php __('Read the release notes and get the latest version'); ?> </a>
<h2><?php __('Editing this Page'); ?></h2>
<h3><?php __('Editing this Page'); ?></h3>
<p>
<?php
__('To change the content of this page, edit: app/views/pages/home.ctp.<br />
To change its layout, edit: app/views/layouts/default.ctp.<br />
You can also add some CSS styles for your pages at: /app/webroot/css.');
__('To change the content of this page, edit: APP/views/pages/home.ctp.<br />
To change its layout, edit: APP/views/layouts/default.ctp.<br />
You can also add some CSS styles for your pages at: APP/webroot/css.');
?>
</p>
<h2><?php __('Getting Started'); ?></h2>
<h3><?php __('Getting Started'); ?></h3>
<p>
<a href="http://manual.cakephp.org/appendix/blog_tutorial"><?php __('The 15 min Blog Tutorial'); ?></a><br />
<a href="http://cakephp.org/files/OCPHP.pdf"><?php __('The OCPHP presentation on new features in 1.2'); ?></a><br />
</p>
<h2><?php __('More about Cake'); ?></h2>
<h3><?php __('More about Cake'); ?></h3>
<p>
<?php __('CakePHP is a rapid development framework for PHP which uses commonly known design patterns like Active Record, Association Data Mapping, Front Controller and MVC.'); ?>
</p>

View file

@ -36,7 +36,67 @@ uses('error');
class ErrorHandlerTest extends UnitTestCase {
function skip() {
$this->skipif (true, 'ConfigureTest not implemented');
$this->skipif (true, 'ErrorHandlerTest not implemented');
}
function testError() {
}
function testError404() {
}
function testMissingController() {
}
function testMissingAction() {
}
function testPrivateAction() {
}
function testMissingTable() {
}
function testMissingDatabase() {
}
function testMissingView() {
}
function testMissingLayout() {
}
function testMissingConnection() {
}
function testMissingHelperFile() {
}
function testMissingHelperClass() {
}
function testMissingComponentFile() {
}
function testMissingComponentClass() {
}
function testMissingModel() {
}
}
?>