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
|
|
|
*/
|
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
|
|
|
*/
|
2010-08-28 05:39:02 +00:00
|
|
|
class ErrorHandler {
|
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
|
|
|
|
*/
|
2010-08-28 05:39:02 +00:00
|
|
|
function __construct(Exception $exception) {
|
|
|
|
App::import('Core', 'Sanitize');
|
2008-11-08 02:54:07 +00:00
|
|
|
|
2010-08-28 23:53:21 +00:00
|
|
|
$this->controller = $this->_getController($exception);
|
2008-05-30 11:40:08 +00:00
|
|
|
|
|
|
|
if (method_exists($this->controller, 'apperror')) {
|
2010-08-28 05:39:02 +00:00
|
|
|
return $this->controller->appError($exception);
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
2010-08-28 05:39:02 +00:00
|
|
|
$method = Inflector::variable(str_replace('Exception', '', get_class($exception)));
|
2008-05-30 11:40:08 +00:00
|
|
|
|
2010-08-28 05:39:02 +00:00
|
|
|
if (!in_array($method, get_class_methods($this))) {
|
2008-05-30 11:40:08 +00:00
|
|
|
$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) {
|
2010-08-29 05:00:36 +00:00
|
|
|
$code = $exception->getCode();
|
2009-11-08 19:07:25 +00:00
|
|
|
$parentClass = get_parent_class($this);
|
2010-08-28 05:39:02 +00:00
|
|
|
if ($parentClass != 'ErrorHandler') {
|
2009-11-08 19:07:25 +00:00
|
|
|
$method = 'error404';
|
|
|
|
}
|
2010-08-29 02:50:29 +00:00
|
|
|
$parentMethods = (array)get_class_methods($parentClass);
|
2010-08-28 05:39:02 +00:00
|
|
|
if (in_array($method, $parentMethods)) {
|
2009-10-09 04:13:08 +00:00
|
|
|
$method = 'error404';
|
|
|
|
}
|
2010-08-29 05:00:36 +00:00
|
|
|
if ($code == 500) {
|
2008-06-21 15:35:17 +00:00
|
|
|
$method = 'error500';
|
|
|
|
}
|
|
|
|
}
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
2010-08-28 23:53:21 +00:00
|
|
|
$this->method = $method;
|
|
|
|
$this->error = $exception;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the controller instance to handle the exception.
|
|
|
|
* Override this method in subclasses to customize the controller used.
|
|
|
|
* This method returns the built in `CakeErrorController` normally, or if an error is repeated
|
|
|
|
* a bare controller will be used.
|
|
|
|
*
|
|
|
|
* @param Exception $exception The exception to get a controller for.
|
|
|
|
* @return Controller
|
|
|
|
*/
|
|
|
|
protected function _getController($exception) {
|
|
|
|
static $__previousError = null;
|
|
|
|
App::import('Controller', 'CakeError');
|
|
|
|
|
|
|
|
if ($__previousError != $exception) {
|
|
|
|
$__previousError = $exception;
|
|
|
|
$controller = new CakeErrorController();
|
|
|
|
} else {
|
|
|
|
$controller = new Controller();
|
|
|
|
$controller->viewPath = 'errors';
|
|
|
|
}
|
2010-08-29 03:32:14 +00:00
|
|
|
return $controller;
|
2010-08-28 05:39:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set as the default exception handler by the CakePHP bootstrap process.
|
|
|
|
* If you wish you use a custom default exception handler use set_exception_handler()
|
|
|
|
* in your app/config/bootstrap.php.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
* @see http://php.net/manual/en/function.set-exception-handler.php
|
|
|
|
*/
|
|
|
|
public static function handleException(Exception $exception) {
|
|
|
|
$error = new ErrorHandler($exception);
|
2010-08-28 23:53:21 +00:00
|
|
|
$error->render();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Renders the response for the exception.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function render() {
|
|
|
|
call_user_func_array(array($this, $this->method), array($this->error));
|
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-08-29 03:32:14 +00:00
|
|
|
public function error(Exception $error) {
|
|
|
|
$this->error404($error);
|
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-08-29 03:32:14 +00:00
|
|
|
public function error404($error) {
|
|
|
|
$url = Router::normalize($this->controller->request->here);
|
2010-08-28 05:39:02 +00:00
|
|
|
$this->controller->response->statusCode(404);
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->controller->set(array(
|
2010-08-29 03:32:14 +00:00
|
|
|
'code' => 404,
|
|
|
|
'name' => $error->getMessage(),
|
|
|
|
'url' => h($url),
|
2008-05-30 11:40:08 +00:00
|
|
|
));
|
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)) {
|
2010-05-29 04:21:02 +00:00
|
|
|
$url = $this->controller->request->here;
|
2009-12-13 20:35:51 +00:00
|
|
|
}
|
|
|
|
$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),
|
2010-05-29 04:21:02 +00:00
|
|
|
'base' => $this->controller->request->base
|
2009-12-13 20:35:51 +00:00
|
|
|
));
|
|
|
|
$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-08-29 05:00:36 +00:00
|
|
|
public function missingAction($error) {
|
|
|
|
$message = $error->getMessage();
|
|
|
|
list($controllerName, $action) = explode('::', $message);
|
2008-06-30 01:09:13 +00:00
|
|
|
$this->controller->set(array(
|
2010-08-29 05:00:36 +00:00
|
|
|
'controller' => $controllerName,
|
2008-06-30 01:09:13 +00:00
|
|
|
'action' => $action,
|
|
|
|
));
|
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-08-29 05:00:36 +00:00
|
|
|
public function privateAction($error) {
|
|
|
|
$message = $error->getMessage();
|
|
|
|
list($controllerName, $action) = explode('::', $message);
|
2008-06-30 01:09:13 +00:00
|
|
|
$this->controller->set(array(
|
2010-08-29 05:00:36 +00:00
|
|
|
'controller' => $controllerName,
|
|
|
|
'action' => $action
|
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-08-29 05:00:36 +00:00
|
|
|
public function missingTable($error) {
|
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(
|
2010-08-29 05:00:36 +00:00
|
|
|
'model' => $error->getModel(),
|
|
|
|
'table' => $error->getTable(),
|
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-08-29 05:00:36 +00:00
|
|
|
public function missingDatabase($exception) {
|
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-08-29 05:00:36 +00:00
|
|
|
public function missingView($error) {
|
2008-06-30 01:09:13 +00:00
|
|
|
$this->controller->set(array(
|
2010-08-29 05:00:36 +00:00
|
|
|
'file' => $error->getMessage(),
|
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-08-29 05:00:36 +00:00
|
|
|
public function missingLayout($error) {
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->controller->layout = 'default';
|
2008-06-30 01:09:13 +00:00
|
|
|
$this->controller->set(array(
|
2010-08-29 05:00:36 +00:00
|
|
|
'file' => $error->getMessage(),
|
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();
|
2010-08-28 05:39:02 +00:00
|
|
|
$this->controller->response->send();
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
|
|
|
}
|