mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Removing instance variables that were no longer needed, as they weren't actually being used for much.
This commit is contained in:
parent
1fe84c00dd
commit
ea80a6dbbb
1 changed files with 5 additions and 32 deletions
|
@ -24,7 +24,7 @@
|
||||||
/**
|
/**
|
||||||
* List of helpers to include
|
* List of helpers to include
|
||||||
*/
|
*/
|
||||||
App::import('Core', array('Router', 'CakeRequest', 'CakeResponse'));
|
App::import('Core', array('Router', 'CakeRequest', 'CakeResponse'), false);
|
||||||
App::import('Controller', 'Controller', false);
|
App::import('Controller', 'Controller', false);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -37,22 +37,6 @@ App::import('Controller', 'Controller', false);
|
||||||
*/
|
*/
|
||||||
class Dispatcher {
|
class Dispatcher {
|
||||||
|
|
||||||
/**
|
|
||||||
* Base URL
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
* @access public
|
|
||||||
*/
|
|
||||||
public $base = false;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* webroot path
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
* @access public
|
|
||||||
*/
|
|
||||||
public $webroot = '/';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Current URL
|
* Current URL
|
||||||
*
|
*
|
||||||
|
@ -61,14 +45,6 @@ class Dispatcher {
|
||||||
*/
|
*/
|
||||||
public $here = false;
|
public $here = false;
|
||||||
|
|
||||||
/**
|
|
||||||
* the params for this request
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
* @access public
|
|
||||||
*/
|
|
||||||
public $params = null;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The request object
|
* The request object
|
||||||
*
|
*
|
||||||
|
@ -129,9 +105,7 @@ class Dispatcher {
|
||||||
}
|
}
|
||||||
|
|
||||||
$request = $this->parseParams($request, $additionalParams);
|
$request = $this->parseParams($request, $additionalParams);
|
||||||
$this->request = $request;
|
$controller = $this->_getController($request);
|
||||||
|
|
||||||
$controller = $this->_getController();
|
|
||||||
|
|
||||||
if (!is_object($controller)) {
|
if (!is_object($controller)) {
|
||||||
Router::setRequestInfo($request);
|
Router::setRequestInfo($request);
|
||||||
|
@ -217,7 +191,6 @@ class Dispatcher {
|
||||||
protected function _extractParams($url, $additionalParams = array()) {
|
protected function _extractParams($url, $additionalParams = array()) {
|
||||||
$defaults = array('pass' => array(), 'named' => array(), 'form' => array());
|
$defaults = array('pass' => array(), 'named' => array(), 'form' => array());
|
||||||
$params = array_merge($defaults, $url, $additionalParams);
|
$params = array_merge($defaults, $url, $additionalParams);
|
||||||
$this->params = $params;
|
|
||||||
|
|
||||||
$params += array('base' => false, 'url' => array());
|
$params += array('base' => false, 'url' => array());
|
||||||
return ltrim(Router::reverse($params), '/');
|
return ltrim(Router::reverse($params), '/');
|
||||||
|
@ -249,15 +222,15 @@ class Dispatcher {
|
||||||
* @param array $params Array of parameters
|
* @param array $params Array of parameters
|
||||||
* @return mixed name of controller if not loaded, or object if loaded
|
* @return mixed name of controller if not loaded, or object if loaded
|
||||||
*/
|
*/
|
||||||
protected function &_getController() {
|
protected function &_getController($request) {
|
||||||
$controller = false;
|
$controller = false;
|
||||||
$ctrlClass = $this->__loadController($this->request);
|
$ctrlClass = $this->__loadController($request);
|
||||||
if (!$ctrlClass) {
|
if (!$ctrlClass) {
|
||||||
return $controller;
|
return $controller;
|
||||||
}
|
}
|
||||||
$ctrlClass .= 'Controller';
|
$ctrlClass .= 'Controller';
|
||||||
if (class_exists($ctrlClass)) {
|
if (class_exists($ctrlClass)) {
|
||||||
$controller = new $ctrlClass($this->request);
|
$controller = new $ctrlClass($request);
|
||||||
}
|
}
|
||||||
return $controller;
|
return $controller;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue