diff --git a/App/Config/cache.php b/App/Config/cache.php index 537090388d3..657172b9c87 100644 --- a/App/Config/cache.php +++ b/App/Config/cache.php @@ -146,3 +146,13 @@ * )); */ Configure::write('Cache.default', array('engine' => 'File')); + +/** + * Enable cache view prefixes. + * + * If set it will be prepended to the cache name for view file caching. This is + * helpful if you deploy the same application via multiple subdomains and languages, + * for instance. Each version can then have its own view cache namespace. + * Note: The final cache file name will then be `prefix_cachefilename`. + */ + //Configure::write('Cache.viewPrefix', 'prefix'); diff --git a/lib/Cake/Model/Model.php b/lib/Cake/Model/Model.php index 5f12484d421..3e18afefc8f 100644 --- a/lib/Cake/Model/Model.php +++ b/lib/Cake/Model/Model.php @@ -2424,7 +2424,7 @@ public function delete($id = null, $cascade = true) { if (!empty($keys[$this->alias])) { $this->updateCounterCache($keys[$this->alias]); } - $this->getEventManager()->dispatch(new CakeEvent('Model.afterDelete', $this)); + $this->getEventManager()->dispatch(new Event('Model.afterDelete', $this)); $this->_clearCache(); $this->id = false; return true; diff --git a/lib/Cake/Test/TestCase/Controller/Component/PaginatorComponentTest.php b/lib/Cake/Test/TestCase/Controller/Component/PaginatorComponentTest.php index aed503f567a..eada623b73d 100644 --- a/lib/Cake/Test/TestCase/Controller/Component/PaginatorComponentTest.php +++ b/lib/Cake/Test/TestCase/Controller/Component/PaginatorComponentTest.php @@ -554,7 +554,7 @@ public function testMergeOptionsMaxLimit() { 'paramType' => 'named', ); $result = $this->Paginator->mergeOptions('Post'); - $expected = array('page' => 1, 'limit' => 500, 'maxLimit' => 150, 'paramType' => 'named'); + $expected = array('page' => 1, 'limit' => 150, 'maxLimit' => 150, 'paramType' => 'named'); $this->assertEquals($expected, $result); } diff --git a/lib/Cake/Test/TestCase/Controller/ControllerTest.php b/lib/Cake/Test/TestCase/Controller/ControllerTest.php index 08cbab64f85..670c0aeda6b 100644 --- a/lib/Cake/Test/TestCase/Controller/ControllerTest.php +++ b/lib/Cake/Test/TestCase/Controller/ControllerTest.php @@ -955,11 +955,11 @@ public function testPaginateBackwardsCompatibility() { $Controller->paginate = array('limit' => '1'); $this->assertEquals(array('limit' => '1'), $Controller->paginate); - $Controller->paginate('ControllerPost'); - $this->assertSame($Controller->params['paging']['ControllerPost']['page'], 1); - $this->assertSame($Controller->params['paging']['ControllerPost']['pageCount'], 3); - $this->assertSame($Controller->params['paging']['ControllerPost']['prevPage'], false); - $this->assertSame($Controller->params['paging']['ControllerPost']['nextPage'], true); + $Controller->paginate('Post'); + $this->assertSame($Controller->request->params['paging']['Post']['page'], 1); + $this->assertSame($Controller->request->params['paging']['Post']['pageCount'], 3); + $this->assertSame($Controller->request->params['paging']['Post']['prevPage'], false); + $this->assertSame($Controller->request->params['paging']['Post']['nextPage'], true); } /** diff --git a/lib/Cake/Test/TestCase/Routing/Route/RouteTest.php b/lib/Cake/Test/TestCase/Routing/Route/RouteTest.php index b0972c40fa0..e6fffb4f969 100644 --- a/lib/Cake/Test/TestCase/Routing/Route/RouteTest.php +++ b/lib/Cake/Test/TestCase/Routing/Route/RouteTest.php @@ -856,7 +856,7 @@ public function testGetNamePlugins() { * @return void */ public function testUTF8PatternOnSection() { - $route = new CakeRoute( + $route = new Route( '/:section', array('plugin' => 'blogs', 'controller' => 'posts' , 'action' => 'index' ), array( @@ -866,11 +866,11 @@ public function testUTF8PatternOnSection() { ); $result = $route->parse('/%D8%A2%D9%85%D9%88%D8%B2%D8%B4'); - $expected = array('section' => 'آموزش', 'plugin' => 'blogs', 'controller' => 'posts', 'action' => 'index', 'pass' => array(), 'named' => array()); + $expected = array('section' => 'آموزش', 'plugin' => 'blogs', 'controller' => 'posts', 'action' => 'index', 'pass' => array()); $this->assertEquals($expected, $result); $result = $route->parse('/weblog'); - $expected = array('section' => 'weblog', 'plugin' => 'blogs', 'controller' => 'posts', 'action' => 'index', 'pass' => array(), 'named' => array()); + $expected = array('section' => 'weblog', 'plugin' => 'blogs', 'controller' => 'posts', 'action' => 'index', 'pass' => array()); $this->assertEquals($expected, $result); } diff --git a/lib/Cake/Test/TestCase/View/Helper/FormHelperTest.php b/lib/Cake/Test/TestCase/View/Helper/FormHelperTest.php index ae18bffec84..300a45e53aa 100644 --- a/lib/Cake/Test/TestCase/View/Helper/FormHelperTest.php +++ b/lib/Cake/Test/TestCase/View/Helper/FormHelperTest.php @@ -1571,7 +1571,7 @@ public function testPasswordValidation() { 'Password', '/label', 'input' => array( - 'type' => 'password', 'name' => 'data[Contact][password]', + 'type' => 'password', 'name' => 'Contact[password]', 'id' => 'ContactPassword', 'class' => 'form-error' ), '/div' @@ -1612,7 +1612,7 @@ public function testEmptyErrorValidation() { 'Password', '/label', 'input' => array( - 'type' => 'password', 'name' => 'data[Contact][password]', + 'type' => 'password', 'name' => 'Contact[password]', 'id' => 'ContactPassword', 'class' => 'form-error' ), '/div' @@ -1653,7 +1653,7 @@ public function testEmptyInputErrorValidation() { 'Password', '/label', 'input' => array( - 'type' => 'password', 'name' => 'data[Contact][password]', + 'type' => 'password', 'name' => 'Contact[password]', 'id' => 'ContactPassword', 'class' => 'form-error' ), '/div' @@ -6179,7 +6179,7 @@ public function testFileUploadField() { $this->Form->request->data['Model']['upload'] = 'no data should be set in value'; $result = $this->Form->file('Model.upload'); - $this->assertTags($result, array('input' => array('type' => 'file', 'name' => 'data[Model][upload]', 'id' => 'ModelUpload'))); + $this->assertTags($result, array('input' => array('type' => 'file', 'name' => 'Model[upload]', 'id' => 'ModelUpload'))); } /**