2008-05-30 11:40:08 +00:00
|
|
|
<?php
|
|
|
|
/**
|
2008-08-22 01:52:37 +00:00
|
|
|
* Error handler
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
2008-08-22 01:52:37 +00:00
|
|
|
* Provides Error Capturing for Framework errors.
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
|
|
|
* PHP versions 4 and 5
|
|
|
|
*
|
2009-11-06 06:46:59 +00:00
|
|
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
2010-01-26 19:18:20 +00:00
|
|
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
|
|
|
* Licensed under The MIT License
|
|
|
|
* Redistributions of files must retain the above copyright notice.
|
|
|
|
*
|
2010-01-26 19:18:20 +00:00
|
|
|
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
2009-11-06 06:00:11 +00:00
|
|
|
* @link http://cakephp.org CakePHP(tm) Project
|
2008-10-30 17:30:26 +00:00
|
|
|
* @package cake
|
|
|
|
* @subpackage cake.cake.libs
|
|
|
|
* @since CakePHP(tm) v 0.10.5.1732
|
2009-11-06 06:51:51 +00:00
|
|
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
2008-05-30 11:40:08 +00:00
|
|
|
*/
|
2008-06-11 15:46:31 +00:00
|
|
|
App::import('Controller', 'App');
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-11 16:01:11 +00:00
|
|
|
/**
|
2008-08-22 01:52:37 +00:00
|
|
|
* Error Handling Controller
|
2008-06-11 16:01:11 +00:00
|
|
|
*
|
2008-08-22 01:52:37 +00:00
|
|
|
* Controller used by ErrorHandler to render error views.
|
2008-06-11 16:01:11 +00:00
|
|
|
*
|
2008-10-30 17:30:26 +00:00
|
|
|
* @package cake
|
|
|
|
* @subpackage cake.cake.libs
|
2008-06-11 16:01:11 +00:00
|
|
|
*/
|
2008-06-11 15:46:31 +00:00
|
|
|
class CakeErrorController extends AppController {
|
2010-04-04 07:14:00 +00:00
|
|
|
public $name = 'CakeError';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-08-22 01:52:37 +00:00
|
|
|
/**
|
|
|
|
* Uses Property
|
|
|
|
*
|
|
|
|
* @var array
|
|
|
|
*/
|
2010-04-04 07:14:00 +00:00
|
|
|
public $uses = array();
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-08-22 01:52:37 +00:00
|
|
|
/**
|
|
|
|
* __construct
|
|
|
|
*
|
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
2008-06-11 15:46:31 +00:00
|
|
|
function __construct() {
|
|
|
|
parent::__construct();
|
|
|
|
$this->_set(Router::getPaths());
|
|
|
|
$this->params = Router::getParams();
|
|
|
|
$this->constructClasses();
|
2008-06-12 18:36:08 +00:00
|
|
|
$this->Component->initialize($this);
|
2008-06-11 15:46:31 +00:00
|
|
|
$this->_set(array('cacheAction' => false, 'viewPath' => 'errors'));
|
|
|
|
}
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
2008-11-08 02:54:07 +00:00
|
|
|
* Error Handler.
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
2008-08-22 01:52:37 +00:00
|
|
|
* Captures and handles all cakeError() calls.
|
|
|
|
* Displays helpful framework errors when debug > 1.
|
|
|
|
* When debug < 1 cakeError() will render 404 or 500 errors.
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
2008-10-30 17:30:26 +00:00
|
|
|
* @package cake
|
|
|
|
* @subpackage cake.cake.libs
|
2008-05-30 11:40:08 +00:00
|
|
|
*/
|
|
|
|
class ErrorHandler extends Object {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
|
|
|
* Controller instance.
|
|
|
|
*
|
2009-03-19 21:10:13 +00:00
|
|
|
* @var Controller
|
2008-05-30 11:40:08 +00:00
|
|
|
* @access public
|
|
|
|
*/
|
2010-04-04 07:14:00 +00:00
|
|
|
public $controller = null;
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
|
|
|
* Class constructor.
|
|
|
|
*
|
|
|
|
* @param string $method Method producing the error
|
|
|
|
* @param array $messages Error messages
|
|
|
|
*/
|
|
|
|
function __construct($method, $messages) {
|
|
|
|
App::import('Core', 'Sanitize');
|
2008-08-22 01:52:37 +00:00
|
|
|
static $__previousError = null;
|
2008-11-08 02:54:07 +00:00
|
|
|
|
2008-08-22 01:52:37 +00:00
|
|
|
if ($__previousError != array($method, $messages)) {
|
|
|
|
$__previousError = array($method, $messages);
|
|
|
|
$this->controller =& new CakeErrorController();
|
|
|
|
} else {
|
|
|
|
$this->controller =& new Controller();
|
|
|
|
$this->controller->viewPath = 'errors';
|
|
|
|
}
|
2008-07-22 23:33:01 +00:00
|
|
|
$options = array('escape' => false);
|
|
|
|
$messages = Sanitize::clean($messages, $options);
|
2008-05-30 11:40:08 +00:00
|
|
|
|
|
|
|
if (!isset($messages[0])) {
|
|
|
|
$messages = array($messages);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (method_exists($this->controller, 'apperror')) {
|
|
|
|
return $this->controller->appError($method, $messages);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!in_array(strtolower($method), array_map('strtolower', get_class_methods($this)))) {
|
|
|
|
$method = 'error';
|
|
|
|
}
|
2008-06-21 15:35:17 +00:00
|
|
|
if ($method !== 'error') {
|
2009-10-09 04:13:08 +00:00
|
|
|
if (Configure::read('debug') == 0) {
|
2009-11-08 19:07:25 +00:00
|
|
|
$parentClass = get_parent_class($this);
|
|
|
|
if (strtolower($parentClass) != 'errorhandler') {
|
|
|
|
$method = 'error404';
|
|
|
|
}
|
2010-01-15 04:17:24 +00:00
|
|
|
$parentMethods = array_map('strtolower', get_class_methods($parentClass));
|
|
|
|
if (in_array(strtolower($method), $parentMethods)) {
|
2009-10-09 04:13:08 +00:00
|
|
|
$method = 'error404';
|
|
|
|
}
|
2008-10-23 00:10:44 +00:00
|
|
|
if (isset($code) && $code == 500) {
|
2008-06-21 15:35:17 +00:00
|
|
|
$method = 'error500';
|
|
|
|
}
|
|
|
|
}
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
2008-06-21 15:35:17 +00:00
|
|
|
$this->dispatchMethod($method, $messages);
|
|
|
|
$this->_stop();
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
|
|
|
* Displays an error page (e.g. 404 Not found).
|
|
|
|
*
|
|
|
|
* @param array $params Parameters for controller
|
|
|
|
*/
|
2010-04-05 03:19:38 +00:00
|
|
|
public function error($params) {
|
2008-05-30 11:40:08 +00:00
|
|
|
extract($params, EXTR_OVERWRITE);
|
|
|
|
$this->controller->set(array(
|
|
|
|
'code' => $code,
|
|
|
|
'name' => $name,
|
|
|
|
'message' => $message,
|
|
|
|
'title' => $code . ' ' . $name
|
|
|
|
));
|
2008-11-11 00:14:38 +00:00
|
|
|
$this->_outputMessage('error404');
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
|
|
|
* Convenience method to display a 404 page.
|
|
|
|
*
|
|
|
|
* @param array $params Parameters for controller
|
|
|
|
*/
|
2010-04-05 03:19:38 +00:00
|
|
|
public function error404($params) {
|
2008-05-30 11:40:08 +00:00
|
|
|
extract($params, EXTR_OVERWRITE);
|
|
|
|
|
|
|
|
if (!isset($url)) {
|
|
|
|
$url = $this->controller->here;
|
|
|
|
}
|
|
|
|
$url = Router::normalize($url);
|
2009-12-13 20:35:51 +00:00
|
|
|
$this->controller->header("HTTP/1.0 404 Not Found");
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->controller->set(array(
|
|
|
|
'code' => '404',
|
2010-04-15 16:00:25 +00:00
|
|
|
'name' => __('Not Found'),
|
2009-02-13 14:56:00 +00:00
|
|
|
'message' => h($url),
|
2008-05-30 11:40:08 +00:00
|
|
|
'base' => $this->controller->base
|
|
|
|
));
|
2008-11-11 00:14:38 +00:00
|
|
|
$this->_outputMessage('error404');
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2009-12-13 20:35:51 +00:00
|
|
|
/**
|
|
|
|
* Convenience method to display a 500 page.
|
|
|
|
*
|
|
|
|
* @param array $params Parameters for controller
|
|
|
|
*/
|
2010-04-05 03:19:38 +00:00
|
|
|
public function error500($params) {
|
2009-12-13 20:35:51 +00:00
|
|
|
extract($params, EXTR_OVERWRITE);
|
|
|
|
|
|
|
|
if (!isset($url)) {
|
|
|
|
$url = $this->controller->here;
|
|
|
|
}
|
|
|
|
$url = Router::normalize($url);
|
2009-12-14 21:21:05 +00:00
|
|
|
$this->controller->header("HTTP/1.0 500 Internal Server Error");
|
2009-12-13 20:35:51 +00:00
|
|
|
$this->controller->set(array(
|
|
|
|
'code' => '500',
|
2010-04-15 16:00:25 +00:00
|
|
|
'name' => __('An Internal Error Has Occurred'),
|
2009-12-13 20:35:51 +00:00
|
|
|
'message' => h($url),
|
|
|
|
'base' => $this->controller->base
|
|
|
|
));
|
|
|
|
$this->_outputMessage('error500');
|
|
|
|
}
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
|
|
|
* Renders the Missing Controller web page.
|
|
|
|
*
|
|
|
|
* @param array $params Parameters for controller
|
|
|
|
*/
|
2010-04-05 03:19:38 +00:00
|
|
|
public function missingController($params) {
|
2008-05-30 11:40:08 +00:00
|
|
|
extract($params, EXTR_OVERWRITE);
|
|
|
|
|
|
|
|
$controllerName = str_replace('Controller', '', $className);
|
2008-06-30 01:09:13 +00:00
|
|
|
$this->controller->set(array(
|
|
|
|
'controller' => $className,
|
|
|
|
'controllerName' => $controllerName,
|
2010-04-15 16:00:25 +00:00
|
|
|
'title' => __('Missing Controller')
|
2008-06-30 01:09:13 +00:00
|
|
|
));
|
2008-11-11 00:14:38 +00:00
|
|
|
$this->_outputMessage('missingController');
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
|
|
|
* Renders the Missing Action web page.
|
|
|
|
*
|
|
|
|
* @param array $params Parameters for controller
|
|
|
|
*/
|
2010-04-05 03:19:38 +00:00
|
|
|
public function missingAction($params) {
|
2008-05-30 11:40:08 +00:00
|
|
|
extract($params, EXTR_OVERWRITE);
|
|
|
|
|
|
|
|
$controllerName = str_replace('Controller', '', $className);
|
2008-06-30 01:09:13 +00:00
|
|
|
$this->controller->set(array(
|
|
|
|
'controller' => $className,
|
|
|
|
'controllerName' => $controllerName,
|
|
|
|
'action' => $action,
|
2010-04-15 16:00:25 +00:00
|
|
|
'title' => __('Missing Method in Controller')
|
2008-06-30 01:09:13 +00:00
|
|
|
));
|
2008-11-11 00:14:38 +00:00
|
|
|
$this->_outputMessage('missingAction');
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
|
|
|
* Renders the Private Action web page.
|
|
|
|
*
|
|
|
|
* @param array $params Parameters for controller
|
|
|
|
*/
|
2010-04-05 03:19:38 +00:00
|
|
|
public function privateAction($params) {
|
2008-05-30 11:40:08 +00:00
|
|
|
extract($params, EXTR_OVERWRITE);
|
|
|
|
|
2008-06-30 01:09:13 +00:00
|
|
|
$this->controller->set(array(
|
|
|
|
'controller' => $className,
|
|
|
|
'action' => $action,
|
2010-04-15 16:00:25 +00:00
|
|
|
'title' => __('Trying to access private method in class')
|
2008-06-30 01:09:13 +00:00
|
|
|
));
|
2008-11-11 00:14:38 +00:00
|
|
|
$this->_outputMessage('privateAction');
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
|
|
|
* Renders the Missing Table web page.
|
|
|
|
*
|
|
|
|
* @param array $params Parameters for controller
|
|
|
|
*/
|
2010-04-05 03:19:38 +00:00
|
|
|
public function missingTable($params) {
|
2008-05-30 11:40:08 +00:00
|
|
|
extract($params, EXTR_OVERWRITE);
|
|
|
|
|
2009-12-13 20:35:51 +00:00
|
|
|
$this->controller->header("HTTP/1.0 500 Internal Server Error");
|
2008-06-30 01:09:13 +00:00
|
|
|
$this->controller->set(array(
|
2009-12-13 20:35:51 +00:00
|
|
|
'code' => '500',
|
2008-06-30 01:09:13 +00:00
|
|
|
'model' => $className,
|
|
|
|
'table' => $table,
|
2010-04-15 16:00:25 +00:00
|
|
|
'title' => __('Missing Database Table')
|
2008-06-30 01:09:13 +00:00
|
|
|
));
|
2008-11-11 00:14:38 +00:00
|
|
|
$this->_outputMessage('missingTable');
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
|
|
|
* Renders the Missing Database web page.
|
|
|
|
*
|
|
|
|
* @param array $params Parameters for controller
|
|
|
|
*/
|
2010-04-05 03:19:38 +00:00
|
|
|
public function missingDatabase($params = array()) {
|
2009-12-13 20:35:51 +00:00
|
|
|
$this->controller->header("HTTP/1.0 500 Internal Server Error");
|
2008-06-30 01:09:13 +00:00
|
|
|
$this->controller->set(array(
|
2009-12-13 20:35:51 +00:00
|
|
|
'code' => '500',
|
2010-04-15 16:00:25 +00:00
|
|
|
'title' => __('Scaffold Missing Database Connection')
|
2008-06-30 01:09:13 +00:00
|
|
|
));
|
2008-11-11 00:14:38 +00:00
|
|
|
$this->_outputMessage('missingScaffolddb');
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
|
|
|
* Renders the Missing View web page.
|
|
|
|
*
|
|
|
|
* @param array $params Parameters for controller
|
|
|
|
*/
|
2010-04-05 03:19:38 +00:00
|
|
|
public function missingView($params) {
|
2008-05-30 11:40:08 +00:00
|
|
|
extract($params, EXTR_OVERWRITE);
|
|
|
|
|
2008-06-30 01:09:13 +00:00
|
|
|
$this->controller->set(array(
|
|
|
|
'controller' => $className,
|
|
|
|
'action' => $action,
|
|
|
|
'file' => $file,
|
2010-04-15 16:00:25 +00:00
|
|
|
'title' => __('Missing View')
|
2008-06-30 01:09:13 +00:00
|
|
|
));
|
2008-11-11 00:14:38 +00:00
|
|
|
$this->_outputMessage('missingView');
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
|
|
|
* Renders the Missing Layout web page.
|
|
|
|
*
|
|
|
|
* @param array $params Parameters for controller
|
|
|
|
*/
|
2010-04-05 03:19:38 +00:00
|
|
|
public function missingLayout($params) {
|
2008-05-30 11:40:08 +00:00
|
|
|
extract($params, EXTR_OVERWRITE);
|
|
|
|
|
|
|
|
$this->controller->layout = 'default';
|
2008-06-30 01:09:13 +00:00
|
|
|
$this->controller->set(array(
|
|
|
|
'file' => $file,
|
2010-04-15 16:00:25 +00:00
|
|
|
'title' => __('Missing Layout')
|
2008-06-30 01:09:13 +00:00
|
|
|
));
|
2008-11-11 00:14:38 +00:00
|
|
|
$this->_outputMessage('missingLayout');
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
|
|
|
* Renders the Database Connection web page.
|
|
|
|
*
|
|
|
|
* @param array $params Parameters for controller
|
|
|
|
*/
|
2010-04-05 03:19:38 +00:00
|
|
|
public function missingConnection($params) {
|
2008-05-30 11:40:08 +00:00
|
|
|
extract($params, EXTR_OVERWRITE);
|
|
|
|
|
2009-12-13 20:35:51 +00:00
|
|
|
$this->controller->header("HTTP/1.0 500 Internal Server Error");
|
2008-06-30 01:09:13 +00:00
|
|
|
$this->controller->set(array(
|
2009-12-13 20:35:51 +00:00
|
|
|
'code' => '500',
|
2008-06-30 01:09:13 +00:00
|
|
|
'model' => $className,
|
2010-04-15 16:00:25 +00:00
|
|
|
'title' => __('Missing Database Connection')
|
2008-06-30 01:09:13 +00:00
|
|
|
));
|
2008-11-11 00:14:38 +00:00
|
|
|
$this->_outputMessage('missingConnection');
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
|
|
|
* Renders the Missing Helper file web page.
|
|
|
|
*
|
|
|
|
* @param array $params Parameters for controller
|
|
|
|
*/
|
2010-04-05 03:19:38 +00:00
|
|
|
public function missingHelperFile($params) {
|
2008-05-30 11:40:08 +00:00
|
|
|
extract($params, EXTR_OVERWRITE);
|
2008-07-05 12:37:18 +00:00
|
|
|
|
2008-06-30 01:09:13 +00:00
|
|
|
$this->controller->set(array(
|
|
|
|
'helperClass' => Inflector::camelize($helper) . "Helper",
|
|
|
|
'file' => $file,
|
2010-04-15 16:00:25 +00:00
|
|
|
'title' => __('Missing Helper File')
|
2008-06-30 01:09:13 +00:00
|
|
|
));
|
2008-11-11 00:14:38 +00:00
|
|
|
$this->_outputMessage('missingHelperFile');
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
|
|
|
* Renders the Missing Helper class web page.
|
|
|
|
*
|
|
|
|
* @param array $params Parameters for controller
|
|
|
|
*/
|
2010-04-05 03:19:38 +00:00
|
|
|
public function missingHelperClass($params) {
|
2008-05-30 11:40:08 +00:00
|
|
|
extract($params, EXTR_OVERWRITE);
|
2008-07-05 12:37:18 +00:00
|
|
|
|
2008-06-30 01:09:13 +00:00
|
|
|
$this->controller->set(array(
|
|
|
|
'helperClass' => Inflector::camelize($helper) . "Helper",
|
|
|
|
'file' => $file,
|
2010-04-15 16:00:25 +00:00
|
|
|
'title' => __('Missing Helper Class')
|
2008-06-30 01:09:13 +00:00
|
|
|
));
|
2008-11-11 00:14:38 +00:00
|
|
|
$this->_outputMessage('missingHelperClass');
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2009-08-26 14:02:55 +00:00
|
|
|
/**
|
|
|
|
* Renders the Missing Behavior file web page.
|
|
|
|
*
|
|
|
|
* @param array $params Parameters for controller
|
|
|
|
*/
|
2010-04-05 03:19:38 +00:00
|
|
|
public function missingBehaviorFile($params) {
|
2009-08-26 14:02:55 +00:00
|
|
|
extract($params, EXTR_OVERWRITE);
|
|
|
|
|
|
|
|
$this->controller->set(array(
|
|
|
|
'behaviorClass' => Inflector::camelize($behavior) . "Behavior",
|
|
|
|
'file' => $file,
|
2010-04-15 16:00:25 +00:00
|
|
|
'title' => __('Missing Behavior File')
|
2009-08-26 14:02:55 +00:00
|
|
|
));
|
|
|
|
$this->_outputMessage('missingBehaviorFile');
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Renders the Missing Behavior class web page.
|
|
|
|
*
|
|
|
|
* @param array $params Parameters for controller
|
|
|
|
*/
|
2010-04-05 03:19:38 +00:00
|
|
|
public function missingBehaviorClass($params) {
|
2009-08-26 14:02:55 +00:00
|
|
|
extract($params, EXTR_OVERWRITE);
|
|
|
|
|
|
|
|
$this->controller->set(array(
|
|
|
|
'behaviorClass' => Inflector::camelize($behavior) . "Behavior",
|
|
|
|
'file' => $file,
|
2010-04-15 16:00:25 +00:00
|
|
|
'title' => __('Missing Behavior Class')
|
2009-08-26 14:02:55 +00:00
|
|
|
));
|
|
|
|
$this->_outputMessage('missingBehaviorClass');
|
|
|
|
}
|
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
|
|
|
* Renders the Missing Component file web page.
|
|
|
|
*
|
|
|
|
* @param array $params Parameters for controller
|
|
|
|
*/
|
2010-04-05 03:19:38 +00:00
|
|
|
public function missingComponentFile($params) {
|
2008-05-30 11:40:08 +00:00
|
|
|
extract($params, EXTR_OVERWRITE);
|
|
|
|
|
2008-06-30 01:09:13 +00:00
|
|
|
$this->controller->set(array(
|
|
|
|
'controller' => $className,
|
|
|
|
'component' => $component,
|
|
|
|
'file' => $file,
|
2010-04-15 16:00:25 +00:00
|
|
|
'title' => __('Missing Component File')
|
2008-06-30 01:09:13 +00:00
|
|
|
));
|
2008-11-11 00:14:38 +00:00
|
|
|
$this->_outputMessage('missingComponentFile');
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
|
|
|
* Renders the Missing Component class web page.
|
|
|
|
*
|
|
|
|
* @param array $params Parameters for controller
|
|
|
|
*/
|
2010-04-05 03:19:38 +00:00
|
|
|
public function missingComponentClass($params) {
|
2008-05-30 11:40:08 +00:00
|
|
|
extract($params, EXTR_OVERWRITE);
|
|
|
|
|
2008-06-30 01:09:13 +00:00
|
|
|
$this->controller->set(array(
|
|
|
|
'controller' => $className,
|
|
|
|
'component' => $component,
|
|
|
|
'file' => $file,
|
2010-04-15 16:00:25 +00:00
|
|
|
'title' => __('Missing Component Class')
|
2008-06-30 01:09:13 +00:00
|
|
|
));
|
2008-11-11 00:14:38 +00:00
|
|
|
$this->_outputMessage('missingComponentClass');
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
|
|
|
* Renders the Missing Model class web page.
|
|
|
|
*
|
|
|
|
* @param unknown_type $params Parameters for controller
|
|
|
|
*/
|
2010-04-05 03:19:38 +00:00
|
|
|
public function missingModel($params) {
|
2008-05-30 11:40:08 +00:00
|
|
|
extract($params, EXTR_OVERWRITE);
|
|
|
|
|
2008-06-30 01:09:13 +00:00
|
|
|
$this->controller->set(array(
|
|
|
|
'model' => $className,
|
2010-04-15 16:00:25 +00:00
|
|
|
'title' => __('Missing Model')
|
2008-06-30 01:09:13 +00:00
|
|
|
));
|
2008-11-11 00:14:38 +00:00
|
|
|
$this->_outputMessage('missingModel');
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
|
|
|
* Output message
|
|
|
|
*
|
|
|
|
*/
|
2010-04-05 03:21:28 +00:00
|
|
|
protected function _outputMessage($template) {
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->controller->render($template);
|
|
|
|
$this->controller->afterFilter();
|
2008-06-11 08:54:27 +00:00
|
|
|
echo $this->controller->output;
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
|
|
|
}
|