Skip to content
Permalink
Browse files

Remove backwards compatibility shim for 1.x/2.x

The overloaded properties removed were added in 2.x to ease upgrading
from 1.x.  Remove them now as they have been deprecated for a long time.
  • Loading branch information...
markstory committed Oct 9, 2012
1 parent 91200dd commit 923a1f138e414e0fb3c6693beb12aafdaa295b89
Showing with 3 additions and 39 deletions.
  1. +1 −14 lib/Cake/Test/TestCase/View/ViewTest.php
  2. +2 −25 lib/Cake/View/View.php
@@ -224,7 +224,7 @@ public function beforeLayout($viewFile) {
* @return void
*/
public function afterLayout($layoutFile) {
$this->_View->output .= 'modified in the afterlife';
$this->_View->append('content', 'modified in the afterlife');
}
}
@@ -1465,19 +1465,6 @@ public function testPropertySetting() {
$this->assertEquals('test', $this->View->pageTitle);
}
/**
* Test that setting arbitrary properties still works.
*
* @return void
*/
public function testPropertySettingMagicGet() {
$this->assertFalse(isset($this->View->action));
$this->View->request->params['action'] = 'login';
$this->assertEquals('login', $this->View->action);
$this->assertTrue(isset($this->View->action));
$this->assertTrue(!empty($this->View->action));
}
/**
* test memory leaks that existed in _paths at one point.
*
@@ -781,25 +781,12 @@ public function set($one, $two = null) {
}
/**
* Magic accessor for helpers. Provides access to attributes that were deprecated.
* Magic accessor for helpers.
*
* @param string $name Name of the attribute to get.
* @return mixed
*/
public function __get($name) {
switch ($name) {
case 'base':
case 'here':
case 'webroot':
case 'data':
return $this->request->{$name};
case 'action':
return $this->request->params['action'];
case 'params':
return $this->request;
case 'output':
return $this->Blocks->get('content');
}
if (isset($this->Helpers->{$name})) {
$this->{$name} = $this->Helpers->{$name};
return $this->Helpers->{$name};
@@ -815,12 +802,7 @@ public function __get($name) {
* @return mixed
*/
public function __set($name, $value) {
switch ($name) {
case 'output':
return $this->Blocks->set('content', $value);
default:
$this->{$name} = $value;
}
$this->{$name} = $value;
}
/**
@@ -833,10 +815,6 @@ public function __isset($name) {
if (isset($this->{$name})) {
return true;
}
$magicGet = array('base', 'here', 'webroot', 'data', 'action', 'params', 'output');
if (in_array($name, $magicGet)) {
return $this->__get($name) !== null;
}
return false;
}
@@ -891,7 +869,6 @@ protected function _render($viewFile, $data = array()) {
if ($initialBlocks !== $remainingBlocks) {
throw new Error\Exception(__d('cake_dev', 'The "%s" block was left open. Blocks are not allowed to cross files.', $this->Blocks->active()));
}
return $content;
}

0 comments on commit 923a1f1

Please sign in to comment.
You can’t perform that action at this time.