Removing reference operators from controller.

Removing cakeDebug as its no longer used.
This commit is contained in:
mark_story 2010-07-10 00:32:35 -04:00
parent 3ae1501fd0
commit 0e2a313145

View file

@ -342,7 +342,7 @@ class Controller extends Object {
} }
$this->modelClass = Inflector::classify($this->name); $this->modelClass = Inflector::classify($this->name);
$this->modelKey = Inflector::underscore($this->modelClass); $this->modelKey = Inflector::underscore($this->modelClass);
$this->Component =& new Component(); $this->Component = new Component();
$childMethods = get_class_methods($this); $childMethods = get_class_methods($this);
$parentMethods = get_class_methods('Controller'); $parentMethods = get_class_methods('Controller');
@ -787,7 +787,7 @@ class Controller extends Object {
$errors = array(); $errors = array();
foreach ($objects as $object) { foreach ($objects as $object) {
if (isset($this->{$object->alias})) { if (isset($this->{$object->alias})) {
$object =& $this->{$object->alias}; $object = $this->{$object->alias};
} }
$object->set($object->data); $object->set($object->data);
$errors = array_merge($errors, $object->invalidFields()); $errors = array_merge($errors, $object->invalidFields());
@ -819,11 +819,7 @@ class Controller extends Object {
$this->params['models'] = $this->modelNames; $this->params['models'] = $this->modelNames;
if (Configure::read('debug') > 2) { $View = new $viewClass($this);
$this->set('cakeDebug', $this);
}
$View =& new $viewClass($this);
if (!empty($this->modelNames)) { if (!empty($this->modelNames)) {
$models = array(); $models = array();
@ -843,7 +839,7 @@ class Controller extends Object {
$models = array_diff(ClassRegistry::keys(), $models); $models = array_diff(ClassRegistry::keys(), $models);
foreach ($models as $currentModel) { foreach ($models as $currentModel) {
if (ClassRegistry::isKeySet($currentModel)) { if (ClassRegistry::isKeySet($currentModel)) {
$currentObject =& ClassRegistry::getObject($currentModel); $currentObject = ClassRegistry::getObject($currentModel);
if (is_a($currentObject, 'Model') && !empty($currentObject->validationErrors)) { if (is_a($currentObject, 'Model') && !empty($currentObject->validationErrors)) {
$View->validationErrors[Inflector::camelize($currentModel)] =& $View->validationErrors[Inflector::camelize($currentModel)] =&
$currentObject->validationErrors; $currentObject->validationErrors;
@ -1006,22 +1002,22 @@ class Controller extends Object {
} }
if ($assoc && isset($this->{$object}->{$assoc})) { if ($assoc && isset($this->{$object}->{$assoc})) {
$object =& $this->{$object}->{$assoc}; $object = $this->{$object}->{$assoc};
} elseif ( } elseif (
$assoc && isset($this->{$this->modelClass}) && $assoc && isset($this->{$this->modelClass}) &&
isset($this->{$this->modelClass}->{$assoc} isset($this->{$this->modelClass}->{$assoc}
)) { )) {
$object =& $this->{$this->modelClass}->{$assoc}; $object = $this->{$this->modelClass}->{$assoc};
} elseif (isset($this->{$object})) { } elseif (isset($this->{$object})) {
$object =& $this->{$object}; $object = $this->{$object};
} elseif ( } elseif (
isset($this->{$this->modelClass}) && isset($this->{$this->modelClass}->{$object} isset($this->{$this->modelClass}) && isset($this->{$this->modelClass}->{$object}
)) { )) {
$object =& $this->{$this->modelClass}->{$object}; $object = $this->{$this->modelClass}->{$object};
} }
} elseif (empty($object) || $object === null) { } elseif (empty($object) || $object === null) {
if (isset($this->{$this->modelClass})) { if (isset($this->{$this->modelClass})) {
$object =& $this->{$this->modelClass}; $object = $this->{$this->modelClass};
} else { } else {
$className = null; $className = null;
$name = $this->uses[0]; $name = $this->uses[0];
@ -1029,9 +1025,9 @@ class Controller extends Object {
list($name, $className) = explode('.', $this->uses[0]); list($name, $className) = explode('.', $this->uses[0]);
} }
if ($className) { if ($className) {
$object =& $this->{$className}; $object = $this->{$className};
} else { } else {
$object =& $this->{$name}; $object = $this->{$name};
} }
} }
} }