mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
Moving calls of cakeError() to using exceptions.
This commit is contained in:
parent
1980c924b9
commit
a15c4f89b4
1 changed files with 13 additions and 20 deletions
|
@ -116,12 +116,7 @@ class Dispatcher extends Object {
|
|||
|
||||
if (!is_object($controller)) {
|
||||
Router::setRequestInfo(array($this->params, array('base' => $this->base, 'webroot' => $this->webroot)));
|
||||
return $this->cakeError('missingController', array(array(
|
||||
'className' => Inflector::camelize($this->params['controller']) . 'Controller',
|
||||
'webroot' => $this->webroot,
|
||||
'url' => $url,
|
||||
'base' => $this->base
|
||||
)));
|
||||
throw new MissingControllerException($this->params['controller'] . 'Controller');
|
||||
}
|
||||
$privateAction = $this->params['action'][0] === '_';
|
||||
$prefixes = Router::prefixes();
|
||||
|
@ -140,13 +135,12 @@ class Dispatcher extends Object {
|
|||
));
|
||||
|
||||
if ($privateAction) {
|
||||
return $this->cakeError('privateAction', array(array(
|
||||
'className' => Inflector::camelize($this->params['controller'] . "Controller"),
|
||||
'action' => $this->params['action'],
|
||||
'webroot' => $this->webroot,
|
||||
'url' => $url,
|
||||
'base' => $this->base
|
||||
)));
|
||||
$message = sprintf(
|
||||
'%s::%s()',
|
||||
Inflector::camelize($this->params['controller']) . "Controller",
|
||||
$this->params['action']
|
||||
);
|
||||
throw new PrivateActionException($message);
|
||||
}
|
||||
$controller->base = $this->base;
|
||||
$controller->here = $this->here;
|
||||
|
@ -191,13 +185,12 @@ class Dispatcher extends Object {
|
|||
App::import('Controller', 'Scaffold', false);
|
||||
return new Scaffold($controller, $params);
|
||||
}
|
||||
return $this->cakeError('missingAction', array(array(
|
||||
'className' => Inflector::camelize($params['controller']."Controller"),
|
||||
'action' => $params['action'],
|
||||
'webroot' => $this->webroot,
|
||||
'url' => $this->here,
|
||||
'base' => $this->base
|
||||
)));
|
||||
$message = sprintf(
|
||||
'%s::%s',
|
||||
Inflector::camelize($params['controller']) . "Controller",
|
||||
$params['action']
|
||||
);
|
||||
throw new MissingActionException($message);
|
||||
}
|
||||
$output = call_user_func_array(array(&$controller, $params['action']), $params['pass']);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue