2010-08-28 05:37:39 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Error Handling Controller
|
|
|
|
*
|
|
|
|
* Controller used by ErrorHandler to render error views.
|
|
|
|
*
|
2011-07-31 23:14:36 +00:00
|
|
|
* PHP 5
|
|
|
|
*
|
|
|
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
2012-03-13 02:46:07 +00:00
|
|
|
* Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
2011-07-31 23:14:36 +00:00
|
|
|
*
|
|
|
|
* Licensed under The MIT License
|
|
|
|
* Redistributions of files must retain the above copyright notice.
|
|
|
|
*
|
2012-03-13 02:46:07 +00:00
|
|
|
* @copyright Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
2011-07-31 23:14:36 +00:00
|
|
|
* @link http://cakephp.org CakePHP(tm) Project
|
2011-07-26 06:16:14 +00:00
|
|
|
* @package Cake.Controller
|
2011-07-31 23:14:36 +00:00
|
|
|
* @since CakePHP(tm) v 2.0
|
|
|
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
2010-08-28 05:37:39 +00:00
|
|
|
*/
|
2011-12-08 15:35:02 +00:00
|
|
|
|
2012-11-01 20:25:37 +00:00
|
|
|
App::uses('AppController', 'Controller');
|
|
|
|
|
2011-12-08 15:35:02 +00:00
|
|
|
/**
|
|
|
|
* Error Handling Controller
|
|
|
|
*
|
|
|
|
* Controller used by ErrorHandler to render error views.
|
|
|
|
*
|
|
|
|
* @package Cake.Controller
|
|
|
|
*/
|
2010-08-28 05:37:39 +00:00
|
|
|
class CakeErrorController extends AppController {
|
2011-07-31 21:05:20 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Controller name
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
2010-08-28 05:37:39 +00:00
|
|
|
public $name = 'CakeError';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Uses Property
|
|
|
|
*
|
|
|
|
* @var array
|
|
|
|
*/
|
|
|
|
public $uses = array();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* __construct
|
|
|
|
*
|
2011-07-29 04:06:43 +00:00
|
|
|
* @param CakeRequest $request
|
|
|
|
* @param CakeResponse $response
|
2010-08-28 05:37:39 +00:00
|
|
|
*/
|
2011-07-03 19:33:27 +00:00
|
|
|
public function __construct($request = null, $response = null) {
|
|
|
|
parent::__construct($request, $response);
|
2012-10-25 15:19:53 +00:00
|
|
|
if (
|
|
|
|
count(Router::extensions()) &&
|
|
|
|
!array_key_exists('RequestHandler', $this->components) &&
|
|
|
|
!in_array('RequestHandler', $this->components, true)
|
|
|
|
) {
|
2011-09-17 01:52:12 +00:00
|
|
|
$this->components[] = 'RequestHandler';
|
|
|
|
}
|
2010-08-28 05:37:39 +00:00
|
|
|
$this->constructClasses();
|
2012-06-19 02:08:39 +00:00
|
|
|
if ($this->Components->enabled('Auth')) {
|
|
|
|
$this->Components->disable('Auth');
|
|
|
|
}
|
|
|
|
if ($this->Components->enabled('Security')) {
|
|
|
|
$this->Components->disable('Security');
|
|
|
|
}
|
2012-04-13 13:57:06 +00:00
|
|
|
$this->startupProcess();
|
2011-09-17 01:52:12 +00:00
|
|
|
|
2011-05-16 22:08:51 +00:00
|
|
|
$this->_set(array('cacheAction' => false, 'viewPath' => 'Errors'));
|
2010-08-28 05:37:39 +00:00
|
|
|
}
|
2010-08-30 03:31:20 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Escapes the viewVars.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
2011-05-28 20:38:46 +00:00
|
|
|
public function beforeRender() {
|
2010-08-30 03:38:46 +00:00
|
|
|
parent::beforeRender();
|
2010-08-30 03:31:20 +00:00
|
|
|
foreach ($this->viewVars as $key => $value) {
|
2011-11-30 15:44:11 +00:00
|
|
|
if (!is_object($value)) {
|
2010-09-06 21:54:48 +00:00
|
|
|
$this->viewVars[$key] = h($value);
|
|
|
|
}
|
2010-08-30 03:31:20 +00:00
|
|
|
}
|
|
|
|
}
|
2012-03-04 00:27:46 +00:00
|
|
|
|
2011-01-02 03:16:12 +00:00
|
|
|
}
|