2006-01-12 02:10:47 +00:00
|
|
|
<?php
|
|
|
|
/* SVN FILE: $Id$ */
|
|
|
|
/**
|
|
|
|
* Short description for file.
|
|
|
|
*
|
|
|
|
* Long description for file
|
|
|
|
*
|
|
|
|
* PHP versions 4 and 5
|
|
|
|
*
|
2007-02-02 10:39:45 +00:00
|
|
|
* CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/>
|
2008-01-01 22:18:17 +00:00
|
|
|
* Copyright 2005-2008, Cake Software Foundation, Inc.
|
2006-05-26 05:29:17 +00:00
|
|
|
* 1785 E. Sahara Avenue, Suite 490-204
|
|
|
|
* Las Vegas, Nevada 89104
|
2006-01-12 02:10:47 +00:00
|
|
|
*
|
|
|
|
* Licensed under The MIT License
|
|
|
|
* Redistributions of files must retain the above copyright notice.
|
|
|
|
*
|
|
|
|
* @filesource
|
2008-01-01 22:18:17 +00:00
|
|
|
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc.
|
2007-02-02 10:39:45 +00:00
|
|
|
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
2006-05-26 05:29:17 +00:00
|
|
|
* @package cake
|
|
|
|
* @subpackage cake.cake.libs
|
2007-02-02 10:39:45 +00:00
|
|
|
* @since CakePHP(tm) v 0.10.5.1732
|
2006-05-26 05:29:17 +00:00
|
|
|
* @version $Revision$
|
|
|
|
* @modifiedby $LastChangedBy$
|
|
|
|
* @lastmodified $Date$
|
|
|
|
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
2006-01-12 02:10:47 +00:00
|
|
|
*/
|
2006-08-05 22:59:01 +00:00
|
|
|
uses('sanitize');
|
2006-01-12 02:10:47 +00:00
|
|
|
/**
|
|
|
|
* Short description for file.
|
|
|
|
*
|
|
|
|
* Long description for file
|
|
|
|
*
|
2006-05-26 05:29:17 +00:00
|
|
|
* @package cake
|
|
|
|
* @subpackage cake.cake.libs
|
2006-01-12 02:10:47 +00:00
|
|
|
*/
|
2006-05-26 05:29:17 +00:00
|
|
|
class ErrorHandler extends Object{
|
2007-05-20 06:30:19 +00:00
|
|
|
/**
|
|
|
|
* Controller instance.
|
|
|
|
*
|
|
|
|
* @var object
|
2007-05-22 02:38:12 +00:00
|
|
|
* @access public
|
2007-05-20 06:30:19 +00:00
|
|
|
*/
|
2006-05-26 05:29:17 +00:00
|
|
|
var $controller = null;
|
2006-01-12 02:10:47 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Class constructor.
|
2006-05-26 05:29:17 +00:00
|
|
|
*
|
2007-05-20 06:30:19 +00:00
|
|
|
* @param string $method Method producing the error
|
|
|
|
* @param array $messages Error messages
|
2006-01-12 02:10:47 +00:00
|
|
|
*/
|
2006-05-26 05:29:17 +00:00
|
|
|
function __construct($method, $messages) {
|
|
|
|
parent::__construct();
|
|
|
|
static $__previousError = null;
|
2006-09-28 17:39:39 +00:00
|
|
|
|
2006-12-25 07:07:57 +00:00
|
|
|
$allow = array('.', '/', '_', ' ', '-', '~');
|
2007-06-20 06:15:35 +00:00
|
|
|
if (substr(PHP_OS,0,3) == "WIN") {
|
2006-09-28 17:39:39 +00:00
|
|
|
$allow = array_merge($allow, array('\\', ':') );
|
|
|
|
}
|
2006-08-05 22:59:01 +00:00
|
|
|
$clean = new Sanitize();
|
2006-09-28 17:39:39 +00:00
|
|
|
$messages = $clean->paranoid($messages, $allow);
|
2007-06-20 06:15:35 +00:00
|
|
|
if (!class_exists('dispatcher')) {
|
2007-05-04 00:25:04 +00:00
|
|
|
require CAKE . 'dispatcher.php';
|
|
|
|
}
|
2006-05-26 05:29:17 +00:00
|
|
|
$this->__dispatch =& new Dispatcher();
|
2007-08-21 21:46:59 +00:00
|
|
|
if (!class_exists('appcontroller')) {
|
Closes #2119 Only define clone() in PHP4 when it hasn't been already defined.
Closes #2213, Support multiple plugin paths.
Closes #2234, filepaths to behavior classes should be cached in class.paths.php also
Closes #2345, ability to group components into subfolders
Closes #2645, Improvement to basic.php for class loading.
Fixes #3526, Cache::write, when using just the config name, it fails.
Fixes #3559, loading plugin model as assoc don't work.
Closes #3567 Controller Folders (Note this does not need routing to work, but controller names can not conflict with others in the same application so naming must still be unique)
Fixes #3579, email.php component: Parse error with php 4.
Adding new class and file importer.
Updated most of the core to use the importer.
Added ClassRegsitry::init() that will create and instance of an object and store it in the registry.
Deprecated most of the load functions in basics.php
Plugin model loading now forces using the dot notation, to use models within a plugin, all the model associations must be in the PluginName.Model syntax, if this is not used, the plugin will look for the models in the main app/models directory first, if not found then it will search the plugin directories recursively until it finds a model.
var $belongsTo = array('SomeModel'); will look for some_model.php in the app/models
var $belongsTo = array('MyPlugin.SomeModel'); will look for some_model.php in my_plugin/models
var $belongsTo = array('MyPlugin.MyPlugin', 'SomeModel'); will used my_plugin/models/my_plugin.php and app/models/some_model.php
The controllers of the plugin will still look for the default models inside the plugin if var $uses is not set:
var $uses = array('SomeModel'); will look for some_model.php in the app/models
var $uses = array('MyPlugin.SomeModel'); will look for some_model.php in my_plugin/models
var $uses = array('MyPlugin.MyPlugin', 'SomeModel'); will used my_plugin/models/my_plugin.php and app/models/some_model.php
All of the above will work between plugins and main app
These changes also allow placing model and controllers is sub directories
Removed old class.paths.php file generation
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6001 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-11-16 09:35:19 +00:00
|
|
|
App::import('Controller', 'App');
|
2007-08-21 21:46:59 +00:00
|
|
|
}
|
Closes #2119 Only define clone() in PHP4 when it hasn't been already defined.
Closes #2213, Support multiple plugin paths.
Closes #2234, filepaths to behavior classes should be cached in class.paths.php also
Closes #2345, ability to group components into subfolders
Closes #2645, Improvement to basic.php for class loading.
Fixes #3526, Cache::write, when using just the config name, it fails.
Fixes #3559, loading plugin model as assoc don't work.
Closes #3567 Controller Folders (Note this does not need routing to work, but controller names can not conflict with others in the same application so naming must still be unique)
Fixes #3579, email.php component: Parse error with php 4.
Adding new class and file importer.
Updated most of the core to use the importer.
Added ClassRegsitry::init() that will create and instance of an object and store it in the registry.
Deprecated most of the load functions in basics.php
Plugin model loading now forces using the dot notation, to use models within a plugin, all the model associations must be in the PluginName.Model syntax, if this is not used, the plugin will look for the models in the main app/models directory first, if not found then it will search the plugin directories recursively until it finds a model.
var $belongsTo = array('SomeModel'); will look for some_model.php in the app/models
var $belongsTo = array('MyPlugin.SomeModel'); will look for some_model.php in my_plugin/models
var $belongsTo = array('MyPlugin.MyPlugin', 'SomeModel'); will used my_plugin/models/my_plugin.php and app/models/some_model.php
The controllers of the plugin will still look for the default models inside the plugin if var $uses is not set:
var $uses = array('SomeModel'); will look for some_model.php in the app/models
var $uses = array('MyPlugin.SomeModel'); will look for some_model.php in my_plugin/models
var $uses = array('MyPlugin.MyPlugin', 'SomeModel'); will used my_plugin/models/my_plugin.php and app/models/some_model.php
All of the above will work between plugins and main app
These changes also allow placing model and controllers is sub directories
Removed old class.paths.php file generation
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6001 3807eeeb-6ff5-0310-8944-8be069107fe0
2007-11-16 09:35:19 +00:00
|
|
|
|
2006-05-26 05:29:17 +00:00
|
|
|
if ($__previousError != array($method, $messages)) {
|
|
|
|
$__previousError = array($method, $messages);
|
2006-05-01 23:50:20 +00:00
|
|
|
|
2006-05-26 05:29:17 +00:00
|
|
|
$this->controller =& new AppController();
|
2007-06-20 06:15:35 +00:00
|
|
|
if (!empty($this->controller->uses)) {
|
2007-04-12 07:38:25 +00:00
|
|
|
$this->controller->constructClasses();
|
|
|
|
}
|
2006-07-29 17:08:23 +00:00
|
|
|
$this->controller->_initComponents();
|
2006-10-31 06:52:04 +00:00
|
|
|
$this->controller->cacheAction = false;
|
2006-05-26 05:29:17 +00:00
|
|
|
$this->__dispatch->start($this->controller);
|
2006-01-12 02:10:47 +00:00
|
|
|
|
2006-05-26 05:29:17 +00:00
|
|
|
if (method_exists($this->controller, 'apperror')) {
|
|
|
|
return $this->controller->appError($method, $messages);
|
|
|
|
}
|
|
|
|
} else {
|
2007-08-21 21:46:59 +00:00
|
|
|
$this->controller =& new AppController();
|
2006-10-31 06:52:04 +00:00
|
|
|
$this->controller->cacheAction = false;
|
2006-05-26 05:29:17 +00:00
|
|
|
}
|
2006-12-05 09:49:59 +00:00
|
|
|
if (Configure::read() > 0 || $method == 'error') {
|
2006-05-26 05:29:17 +00:00
|
|
|
call_user_func_array(array(&$this, $method), $messages);
|
|
|
|
} else {
|
|
|
|
call_user_func_array(array(&$this, 'error404'), $messages);
|
|
|
|
}
|
|
|
|
}
|
2006-01-12 02:10:47 +00:00
|
|
|
/**
|
|
|
|
* Displays an error page (e.g. 404 Not found).
|
|
|
|
*
|
2007-05-20 06:30:19 +00:00
|
|
|
* @param array $params Parameters for controller
|
|
|
|
* @access public
|
2006-01-12 02:10:47 +00:00
|
|
|
*/
|
2006-05-26 05:29:17 +00:00
|
|
|
function error($params) {
|
|
|
|
extract($params);
|
|
|
|
$this->controller->base = $base;
|
|
|
|
$this->controller->webroot = $this->_webroot();
|
2007-11-04 07:03:57 +00:00
|
|
|
$this->controller->viewPath = 'errors';
|
2006-05-26 05:29:17 +00:00
|
|
|
$this->controller->set(array('code' => $code,
|
|
|
|
'name' => $name,
|
|
|
|
'message' => $message,
|
|
|
|
'title' => $code . ' ' . $name));
|
|
|
|
$this->controller->render('error404');
|
|
|
|
exit();
|
|
|
|
}
|
2006-01-12 02:10:47 +00:00
|
|
|
/**
|
|
|
|
* Convenience method to display a 404 page.
|
|
|
|
*
|
2007-05-20 06:30:19 +00:00
|
|
|
* @param array $params Parameters for controller
|
|
|
|
* @access public
|
2006-01-12 02:10:47 +00:00
|
|
|
*/
|
2006-05-26 05:29:17 +00:00
|
|
|
function error404($params) {
|
|
|
|
extract($params);
|
2006-03-26 09:59:40 +00:00
|
|
|
|
2006-05-26 05:29:17 +00:00
|
|
|
if (!isset($url)) {
|
|
|
|
$url = $action;
|
|
|
|
}
|
|
|
|
if (!isset($message)) {
|
|
|
|
$message = '';
|
|
|
|
}
|
|
|
|
if (!isset($base)) {
|
|
|
|
$base = '';
|
|
|
|
}
|
2006-01-12 02:10:47 +00:00
|
|
|
|
2006-05-26 05:29:17 +00:00
|
|
|
header("HTTP/1.0 404 Not Found");
|
|
|
|
$this->error(array('code' => '404',
|
2007-11-04 07:03:57 +00:00
|
|
|
'name' => __('Not Found', true),
|
|
|
|
'message' => sprintf(__("The requested address %s was not found on this server.", true), "<strong>'{$url}'</strong>", $message),
|
2006-05-26 05:29:17 +00:00
|
|
|
'base' => $base));
|
|
|
|
exit();
|
|
|
|
}
|
2006-01-12 02:10:47 +00:00
|
|
|
/**
|
|
|
|
* Renders the Missing Controller web page.
|
|
|
|
*
|
2007-05-20 06:30:19 +00:00
|
|
|
* @param array $params Parameters for controller
|
|
|
|
* @access public
|
2006-01-12 02:10:47 +00:00
|
|
|
*/
|
2006-05-26 05:29:17 +00:00
|
|
|
function missingController($params) {
|
2006-10-20 17:24:37 +00:00
|
|
|
extract(Router::getPaths());
|
|
|
|
extract($params, EXTR_OVERWRITE);
|
|
|
|
|
2006-05-26 05:29:17 +00:00
|
|
|
$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,
|
2007-05-20 06:30:19 +00:00
|
|
|
'title' => __('Missing Controller', true)));
|
2006-05-26 05:29:17 +00:00
|
|
|
$this->controller->render('missingController');
|
|
|
|
exit();
|
|
|
|
}
|
2006-01-12 02:10:47 +00:00
|
|
|
/**
|
|
|
|
* Renders the Missing Action web page.
|
|
|
|
*
|
2007-05-20 06:30:19 +00:00
|
|
|
* @param array $params Parameters for controller
|
|
|
|
* @access public
|
2006-01-12 02:10:47 +00:00
|
|
|
*/
|
2006-05-26 05:29:17 +00:00
|
|
|
function missingAction($params) {
|
2006-10-20 17:24:37 +00:00
|
|
|
extract(Router::getPaths());
|
|
|
|
extract($params, EXTR_OVERWRITE);
|
|
|
|
|
2006-05-26 05:29:17 +00:00
|
|
|
$this->controller->base = $base;
|
|
|
|
$this->controller->webroot = $webroot;
|
|
|
|
$this->controller->viewPath = 'errors';
|
2007-11-04 07:03:57 +00:00
|
|
|
$controllerName = str_replace('Controller', '', $className);
|
2006-05-26 05:29:17 +00:00
|
|
|
$this->controller->set(array('controller' => $className,
|
2007-11-04 07:03:57 +00:00
|
|
|
'controllerName' => $controllerName,
|
2006-05-26 05:29:17 +00:00
|
|
|
'action' => $action,
|
2007-05-20 06:30:19 +00:00
|
|
|
'title' => __('Missing Method in Controller', true)));
|
2006-05-26 05:29:17 +00:00
|
|
|
$this->controller->render('missingAction');
|
|
|
|
exit();
|
|
|
|
}
|
2006-01-12 02:10:47 +00:00
|
|
|
/**
|
|
|
|
* Renders the Private Action web page.
|
|
|
|
*
|
2007-05-20 06:30:19 +00:00
|
|
|
* @param array $params Parameters for controller
|
|
|
|
* @access public
|
2006-01-12 02:10:47 +00:00
|
|
|
*/
|
2006-05-26 05:29:17 +00:00
|
|
|
function privateAction($params) {
|
2006-10-20 17:24:37 +00:00
|
|
|
extract(Router::getPaths());
|
|
|
|
extract($params, EXTR_OVERWRITE);
|
|
|
|
|
2006-05-26 05:29:17 +00:00
|
|
|
$this->controller->base = $base;
|
|
|
|
$this->controller->webroot = $webroot;
|
|
|
|
$this->controller->viewPath = 'errors';
|
|
|
|
$this->controller->set(array('controller' => $className,
|
|
|
|
'action' => $action,
|
2007-05-20 06:30:19 +00:00
|
|
|
'title' => __('Trying to access private method in class', true)));
|
2006-05-26 05:29:17 +00:00
|
|
|
$this->controller->render('privateAction');
|
|
|
|
exit();
|
|
|
|
}
|
2006-01-12 02:10:47 +00:00
|
|
|
/**
|
|
|
|
* Renders the Missing Table web page.
|
|
|
|
*
|
2007-05-20 06:30:19 +00:00
|
|
|
* @param array $params Parameters for controller
|
|
|
|
* @access public
|
2006-01-12 02:10:47 +00:00
|
|
|
*/
|
2006-05-26 05:29:17 +00:00
|
|
|
function missingTable($params) {
|
2006-10-20 17:24:37 +00:00
|
|
|
extract(Router::getPaths());
|
|
|
|
extract($params, EXTR_OVERWRITE);
|
|
|
|
|
2006-05-26 05:29:17 +00:00
|
|
|
$this->controller->viewPath = 'errors';
|
|
|
|
$this->controller->webroot = $this->_webroot();
|
|
|
|
$this->controller->set(array('model' => $className,
|
|
|
|
'table' => $table,
|
2007-05-20 06:30:19 +00:00
|
|
|
'title' => __('Missing Database Table', true)));
|
2006-05-26 05:29:17 +00:00
|
|
|
$this->controller->render('missingTable');
|
|
|
|
exit();
|
|
|
|
}
|
2006-01-12 02:10:47 +00:00
|
|
|
/**
|
|
|
|
* Renders the Missing Database web page.
|
|
|
|
*
|
2007-05-20 06:30:19 +00:00
|
|
|
* @param array $params Parameters for controller
|
|
|
|
* @access public
|
2006-01-12 02:10:47 +00:00
|
|
|
*/
|
2006-05-26 05:29:17 +00:00
|
|
|
function missingDatabase($params = array()) {
|
2006-10-20 17:24:37 +00:00
|
|
|
extract(Router::getPaths());
|
|
|
|
extract($params, EXTR_OVERWRITE);
|
|
|
|
|
2006-05-26 05:29:17 +00:00
|
|
|
$this->controller->viewPath = 'errors';
|
|
|
|
$this->controller->webroot = $this->_webroot();
|
2007-05-20 06:30:19 +00:00
|
|
|
$this->controller->set(array('title' => __('Scaffold Missing Database Connection', true)));
|
2006-05-26 05:29:17 +00:00
|
|
|
$this->controller->render('missingScaffolddb');
|
|
|
|
exit();
|
|
|
|
}
|
2006-01-12 02:10:47 +00:00
|
|
|
/**
|
|
|
|
* Renders the Missing View web page.
|
|
|
|
*
|
2007-05-20 06:30:19 +00:00
|
|
|
* @param array $params Parameters for controller
|
|
|
|
* @access public
|
2006-01-12 02:10:47 +00:00
|
|
|
*/
|
2006-05-26 05:29:17 +00:00
|
|
|
function missingView($params) {
|
2006-10-20 17:24:37 +00:00
|
|
|
extract(Router::getPaths());
|
|
|
|
extract($params, EXTR_OVERWRITE);
|
|
|
|
|
2006-05-26 05:29:17 +00:00
|
|
|
$this->controller->base = $base;
|
|
|
|
$this->controller->viewPath = 'errors';
|
|
|
|
$this->controller->webroot = $this->_webroot();
|
|
|
|
$this->controller->set(array('controller' => $className,
|
|
|
|
'action' => $action,
|
|
|
|
'file' => $file,
|
2007-05-20 06:30:19 +00:00
|
|
|
'title' => __('Missing View', true)));
|
2006-05-26 05:29:17 +00:00
|
|
|
$this->controller->render('missingView');
|
|
|
|
exit();
|
|
|
|
}
|
2006-01-13 23:53:23 +00:00
|
|
|
/**
|
|
|
|
* Renders the Missing Layout web page.
|
|
|
|
*
|
2007-05-20 06:30:19 +00:00
|
|
|
* @param array $params Parameters for controller
|
|
|
|
* @access public
|
2006-01-13 23:53:23 +00:00
|
|
|
*/
|
2006-05-26 05:29:17 +00:00
|
|
|
function missingLayout($params) {
|
2006-10-20 17:24:37 +00:00
|
|
|
extract(Router::getPaths());
|
|
|
|
extract($params, EXTR_OVERWRITE);
|
|
|
|
|
2006-05-26 05:29:17 +00:00
|
|
|
$this->controller->base = $base;
|
|
|
|
$this->controller->viewPath = 'errors';
|
|
|
|
$this->controller->webroot = $this->_webroot();
|
|
|
|
$this->controller->layout = 'default';
|
|
|
|
$this->controller->set(array('file' => $file,
|
2007-05-20 06:30:19 +00:00
|
|
|
'title' => __('Missing Layout', true)));
|
2006-05-26 05:29:17 +00:00
|
|
|
$this->controller->render('missingLayout');
|
|
|
|
exit();
|
|
|
|
}
|
2006-01-12 02:10:47 +00:00
|
|
|
/**
|
2006-05-26 05:29:17 +00:00
|
|
|
* Renders the Database Connection web page.
|
2006-01-12 02:10:47 +00:00
|
|
|
*
|
2007-05-20 06:30:19 +00:00
|
|
|
* @param array $params Parameters for controller
|
|
|
|
* @access public
|
2006-01-12 02:10:47 +00:00
|
|
|
*/
|
2006-05-26 05:29:17 +00:00
|
|
|
function missingConnection($params) {
|
2006-10-20 17:24:37 +00:00
|
|
|
extract(Router::getPaths());
|
|
|
|
extract($params, EXTR_OVERWRITE);
|
|
|
|
|
2006-05-26 05:29:17 +00:00
|
|
|
$this->controller->viewPath = 'errors';
|
|
|
|
$this->controller->webroot = $this->_webroot();
|
|
|
|
$this->controller->set(array('model' => $className,
|
2007-05-20 06:30:19 +00:00
|
|
|
'title' => __('Missing Database Connection', true)));
|
2006-05-26 05:29:17 +00:00
|
|
|
$this->controller->render('missingConnection');
|
|
|
|
exit();
|
|
|
|
}
|
2006-01-12 03:56:59 +00:00
|
|
|
/**
|
|
|
|
* Renders the Missing Helper file web page.
|
|
|
|
*
|
2007-05-20 06:30:19 +00:00
|
|
|
* @param array $params Parameters for controller
|
|
|
|
* @access public
|
2006-01-12 03:56:59 +00:00
|
|
|
*/
|
2006-05-26 05:29:17 +00:00
|
|
|
function missingHelperFile($params) {
|
2006-10-20 17:24:37 +00:00
|
|
|
extract(Router::getPaths());
|
|
|
|
extract($params, EXTR_OVERWRITE);
|
|
|
|
|
2006-05-26 05:29:17 +00:00
|
|
|
$this->controller->base = $base;
|
|
|
|
$this->controller->viewPath = 'errors';
|
|
|
|
$this->controller->webroot = $this->_webroot();
|
|
|
|
$this->controller->set(array('helperClass' => Inflector::camelize($helper) . "Helper",
|
|
|
|
'file' => $file,
|
2007-05-20 06:30:19 +00:00
|
|
|
'title' => __('Missing Helper File', true)));
|
2006-05-26 05:29:17 +00:00
|
|
|
$this->controller->render('missingHelperFile');
|
|
|
|
exit();
|
|
|
|
}
|
2006-01-12 03:56:59 +00:00
|
|
|
/**
|
|
|
|
* Renders the Missing Helper class web page.
|
|
|
|
*
|
2007-05-20 06:30:19 +00:00
|
|
|
* @param array $params Parameters for controller
|
|
|
|
* @access public
|
2006-01-12 03:56:59 +00:00
|
|
|
*/
|
2006-05-26 05:29:17 +00:00
|
|
|
function missingHelperClass($params) {
|
2006-10-20 17:24:37 +00:00
|
|
|
extract(Router::getPaths());
|
|
|
|
extract($params, EXTR_OVERWRITE);
|
|
|
|
|
2006-05-26 05:29:17 +00:00
|
|
|
$this->controller->base = $base;
|
|
|
|
$this->controller->viewPath = 'errors';
|
|
|
|
$this->controller->webroot = $this->_webroot();
|
|
|
|
$this->controller->set(array('helperClass' => Inflector::camelize($helper) . "Helper",
|
|
|
|
'file' => $file,
|
2007-05-20 06:30:19 +00:00
|
|
|
'title' => __('Missing Helper Class', true)));
|
2006-05-26 05:29:17 +00:00
|
|
|
$this->controller->render('missingHelperClass');
|
|
|
|
exit();
|
|
|
|
}
|
2006-01-13 23:53:23 +00:00
|
|
|
/**
|
|
|
|
* Renders the Missing Component file web page.
|
|
|
|
*
|
2007-05-20 06:30:19 +00:00
|
|
|
* @param array $params Parameters for controller
|
|
|
|
* @access public
|
2006-01-13 23:53:23 +00:00
|
|
|
*/
|
2006-05-26 05:29:17 +00:00
|
|
|
function missingComponentFile($params) {
|
2006-10-20 17:24:37 +00:00
|
|
|
extract(Router::getPaths());
|
|
|
|
extract($params, EXTR_OVERWRITE);
|
|
|
|
|
2006-05-26 05:29:17 +00:00
|
|
|
$this->controller->base = $base;
|
|
|
|
$this->controller->viewPath = 'errors';
|
|
|
|
$this->controller->webroot = $this->_webroot();
|
|
|
|
$this->controller->set(array('controller' => $className,
|
|
|
|
'component' => $component,
|
|
|
|
'file' => $file,
|
2007-05-20 06:30:19 +00:00
|
|
|
'title' => __('Missing Component File', true)));
|
2006-05-26 05:29:17 +00:00
|
|
|
$this->controller->render('missingComponentFile');
|
|
|
|
exit();
|
|
|
|
}
|
2006-01-13 23:53:23 +00:00
|
|
|
/**
|
|
|
|
* Renders the Missing Component class web page.
|
|
|
|
*
|
2007-05-20 06:30:19 +00:00
|
|
|
* @param array $params Parameters for controller
|
|
|
|
* @access public
|
2006-01-13 23:53:23 +00:00
|
|
|
*/
|
2006-05-26 05:29:17 +00:00
|
|
|
function missingComponentClass($params) {
|
2006-10-20 17:24:37 +00:00
|
|
|
extract(Router::getPaths());
|
|
|
|
extract($params, EXTR_OVERWRITE);
|
|
|
|
|
2006-05-26 05:29:17 +00:00
|
|
|
$this->controller->base = $base;
|
|
|
|
$this->controller->viewPath = 'errors';
|
|
|
|
$this->controller->webroot = $this->_webroot();
|
|
|
|
$this->controller->set(array('controller' => $className,
|
|
|
|
'component' => $component,
|
|
|
|
'file' => $file,
|
2007-05-20 06:30:19 +00:00
|
|
|
'title' => __('Missing Component Class', true)));
|
2006-05-26 05:29:17 +00:00
|
|
|
$this->controller->render('missingComponentClass');
|
|
|
|
exit();
|
|
|
|
}
|
2006-02-01 13:26:23 +00:00
|
|
|
/**
|
|
|
|
* Renders the Missing Model class web page.
|
|
|
|
*
|
2007-05-20 06:30:19 +00:00
|
|
|
* @param unknown_type $params Parameters for controller
|
|
|
|
* @access public
|
2006-02-01 13:26:23 +00:00
|
|
|
*/
|
2006-05-26 05:29:17 +00:00
|
|
|
function missingModel($params) {
|
2006-10-20 17:24:37 +00:00
|
|
|
extract(Router::getPaths());
|
|
|
|
extract($params, EXTR_OVERWRITE);
|
|
|
|
|
2006-05-26 05:29:17 +00:00
|
|
|
$this->controller->base = $base;
|
|
|
|
$this->controller->viewPath = 'errors';
|
|
|
|
$this->controller->webroot = $this->_webroot();
|
|
|
|
$this->controller->set(array('model' => $className,
|
2007-05-20 06:30:19 +00:00
|
|
|
'title' => __('Missing Model', true)));
|
2006-05-26 05:29:17 +00:00
|
|
|
$this->controller->render('missingModel');
|
|
|
|
exit();
|
|
|
|
}
|
2006-01-12 03:56:59 +00:00
|
|
|
/**
|
2006-05-26 05:29:17 +00:00
|
|
|
* Path to the web root.
|
2006-01-12 03:56:59 +00:00
|
|
|
*
|
2006-05-26 05:29:17 +00:00
|
|
|
* @return string full web root path
|
2007-05-20 06:30:19 +00:00
|
|
|
* @access private
|
2006-01-12 03:56:59 +00:00
|
|
|
*/
|
2006-05-26 05:29:17 +00:00
|
|
|
function _webroot() {
|
|
|
|
$this->__dispatch->baseUrl();
|
|
|
|
return $this->__dispatch->webroot;
|
|
|
|
}
|
2006-01-12 02:10:47 +00:00
|
|
|
}
|
|
|
|
?>
|