From f9435aff277f9a06be11af41ebe8e6748f736832 Mon Sep 17 00:00:00 2001 From: Bryan Crowe Date: Mon, 14 Oct 2013 22:43:17 -0400 Subject: [PATCH 01/51] Add missing return tags --- lib/Cake/View/Helper/NumberHelper.php | 1 + lib/Cake/View/Helper/TextHelper.php | 1 + lib/Cake/View/Helper/TimeHelper.php | 1 + 3 files changed, 3 insertions(+) diff --git a/lib/Cake/View/Helper/NumberHelper.php b/lib/Cake/View/Helper/NumberHelper.php index 007c6cdbd..7e080cbda 100644 --- a/lib/Cake/View/Helper/NumberHelper.php +++ b/lib/Cake/View/Helper/NumberHelper.php @@ -68,6 +68,7 @@ class NumberHelper extends AppHelper { /** * Call methods from CakeNumber utility class + * @return mixed Whatever is returned by called method, or false on failure */ public function __call($method, $params) { return call_user_func_array(array($this->_engine, $method), $params); diff --git a/lib/Cake/View/Helper/TextHelper.php b/lib/Cake/View/Helper/TextHelper.php index ffa89b543..22a69b638 100644 --- a/lib/Cake/View/Helper/TextHelper.php +++ b/lib/Cake/View/Helper/TextHelper.php @@ -83,6 +83,7 @@ class TextHelper extends AppHelper { /** * Call methods from String utility class + * @return mixed Whatever is returned by called method, or false on failure */ public function __call($method, $params) { return call_user_func_array(array($this->_engine, $method), $params); diff --git a/lib/Cake/View/Helper/TimeHelper.php b/lib/Cake/View/Helper/TimeHelper.php index 211279f6d..987df9d06 100644 --- a/lib/Cake/View/Helper/TimeHelper.php +++ b/lib/Cake/View/Helper/TimeHelper.php @@ -117,6 +117,7 @@ class TimeHelper extends AppHelper { /** * Call methods from CakeTime utility class + * @return mixed Whatever is returned by called method, or false on failure */ public function __call($method, $params) { return call_user_func_array(array($this->_engine, $method), $params); From 5c8eb5c5a730c07a6b57fc0fc904ab13aa7d2db3 Mon Sep 17 00:00:00 2001 From: mark_story Date: Tue, 15 Oct 2013 17:48:26 -0400 Subject: [PATCH 02/51] Add test cases for pluralization/singularlization of quota. Closes #2077 --- lib/Cake/Test/Case/Utility/InflectorTest.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/Cake/Test/Case/Utility/InflectorTest.php b/lib/Cake/Test/Case/Utility/InflectorTest.php index c1dabe50b..00cc702e1 100644 --- a/lib/Cake/Test/Case/Utility/InflectorTest.php +++ b/lib/Cake/Test/Case/Utility/InflectorTest.php @@ -120,6 +120,7 @@ class InflectorTest extends CakeTestCase { $this->assertEquals(Inflector::singularize('objectives'), 'objective'); $this->assertEquals(Inflector::singularize('archives'), 'archive'); $this->assertEquals(Inflector::singularize('briefs'), 'brief'); + $this->assertEquals(Inflector::singularize('quotas'), 'quota'); $this->assertEquals(Inflector::singularize(''), ''); } @@ -181,6 +182,7 @@ class InflectorTest extends CakeTestCase { $this->assertEquals(Inflector::pluralize('foot'), 'feet'); $this->assertEquals(Inflector::pluralize('objective'), 'objectives'); $this->assertEquals(Inflector::pluralize('brief'), 'briefs'); + $this->assertEquals(Inflector::pluralize('quota'), 'quotas'); $this->assertEquals(Inflector::pluralize(''), ''); } From fcb7f86b76bd779b35758c678b1c54f170ae31a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=BCrth?= Date: Wed, 16 Oct 2013 01:40:45 +0200 Subject: [PATCH 03/51] include calls without parentheses Refs https://github.com/cakephp/cakephp/pull/1698/files#r6748085 --- app/Console/cake.php | 2 +- app/webroot/index.php | 4 ++-- app/webroot/test.php | 4 ++-- lib/Cake/Console/Templates/skel/Console/cake.php | 2 +- lib/Cake/Console/Templates/skel/webroot/index.php | 4 ++-- lib/Cake/Console/Templates/skel/webroot/test.php | 4 ++-- lib/Cake/View/View.php | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/app/Console/cake.php b/app/Console/cake.php index 9c2751028..3e24579b7 100644 --- a/app/Console/cake.php +++ b/app/Console/cake.php @@ -29,7 +29,7 @@ if (function_exists('ini_set')) { ini_set('include_path', $root . $ds . 'lib' . PATH_SEPARATOR . ini_get('include_path')); } -if (!include ($dispatcher)) { +if (!include $dispatcher) { trigger_error('Could not locate CakePHP core files.', E_USER_ERROR); } unset($paths, $path, $dispatcher, $root, $ds); diff --git a/app/webroot/index.php b/app/webroot/index.php index 9e87e31d8..cda5040c1 100644 --- a/app/webroot/index.php +++ b/app/webroot/index.php @@ -89,11 +89,11 @@ if (!defined('CAKE_CORE_INCLUDE_PATH')) { if (function_exists('ini_set')) { ini_set('include_path', ROOT . DS . 'lib' . PATH_SEPARATOR . ini_get('include_path')); } - if (!include ('Cake' . DS . 'bootstrap.php')) { + if (!include 'Cake' . DS . 'bootstrap.php') { $failed = true; } } else { - if (!include (CAKE_CORE_INCLUDE_PATH . DS . 'Cake' . DS . 'bootstrap.php')) { + if (!include CAKE_CORE_INCLUDE_PATH . DS . 'Cake' . DS . 'bootstrap.php') { $failed = true; } } diff --git a/app/webroot/test.php b/app/webroot/test.php index bccfe2272..cbd0f02a8 100644 --- a/app/webroot/test.php +++ b/app/webroot/test.php @@ -79,11 +79,11 @@ if (!defined('CAKE_CORE_INCLUDE_PATH')) { if (function_exists('ini_set')) { ini_set('include_path', ROOT . DS . 'lib' . PATH_SEPARATOR . ini_get('include_path')); } - if (!include ('Cake' . DS . 'bootstrap.php')) { + if (!include 'Cake' . DS . 'bootstrap.php') { $failed = true; } } else { - if (!include (CAKE_CORE_INCLUDE_PATH . DS . 'Cake' . DS . 'bootstrap.php')) { + if (!include CAKE_CORE_INCLUDE_PATH . DS . 'Cake' . DS . 'bootstrap.php') { $failed = true; } } diff --git a/lib/Cake/Console/Templates/skel/Console/cake.php b/lib/Cake/Console/Templates/skel/Console/cake.php index dc48cb9e9..9499f8478 100644 --- a/lib/Cake/Console/Templates/skel/Console/cake.php +++ b/lib/Cake/Console/Templates/skel/Console/cake.php @@ -29,7 +29,7 @@ if (function_exists('ini_set')) { ini_set('include_path', $root . PATH_SEPARATOR . __CAKE_PATH__ . PATH_SEPARATOR . ini_get('include_path')); } -if (!include ($dispatcher)) { +if (!include $dispatcher) { trigger_error('Could not locate CakePHP core files.', E_USER_ERROR); } unset($paths, $path, $dispatcher, $root, $ds); diff --git a/lib/Cake/Console/Templates/skel/webroot/index.php b/lib/Cake/Console/Templates/skel/webroot/index.php index c17e95625..c9cf292ed 100644 --- a/lib/Cake/Console/Templates/skel/webroot/index.php +++ b/lib/Cake/Console/Templates/skel/webroot/index.php @@ -80,11 +80,11 @@ if (!defined('CAKE_CORE_INCLUDE_PATH')) { if (function_exists('ini_set')) { ini_set('include_path', ROOT . DS . 'lib' . PATH_SEPARATOR . ini_get('include_path')); } - if (!include ('Cake' . DS . 'bootstrap.php')) { + if (!include 'Cake' . DS . 'bootstrap.php') { $failed = true; } } else { - if (!include (CAKE_CORE_INCLUDE_PATH . DS . 'Cake' . DS . 'bootstrap.php')) { + if (!include CAKE_CORE_INCLUDE_PATH . DS . 'Cake' . DS . 'bootstrap.php') { $failed = true; } } diff --git a/lib/Cake/Console/Templates/skel/webroot/test.php b/lib/Cake/Console/Templates/skel/webroot/test.php index 70bd0afd3..3ec2f00c3 100644 --- a/lib/Cake/Console/Templates/skel/webroot/test.php +++ b/lib/Cake/Console/Templates/skel/webroot/test.php @@ -70,11 +70,11 @@ if (!defined('CAKE_CORE_INCLUDE_PATH')) { if (function_exists('ini_set')) { ini_set('include_path', ROOT . DS . 'lib' . PATH_SEPARATOR . ini_get('include_path')); } - if (!include ('Cake' . DS . 'bootstrap.php')) { + if (!include 'Cake' . DS . 'bootstrap.php') { $failed = true; } } else { - if (!include (CAKE_CORE_INCLUDE_PATH . DS . 'Cake' . DS . 'bootstrap.php')) { + if (!include CAKE_CORE_INCLUDE_PATH . DS . 'Cake' . DS . 'bootstrap.php') { $failed = true; } } diff --git a/lib/Cake/View/View.php b/lib/Cake/View/View.php index 78a042b69..f182e789d 100644 --- a/lib/Cake/View/View.php +++ b/lib/Cake/View/View.php @@ -539,7 +539,7 @@ class View extends Object { public function renderCache($filename, $timeStart) { $response = $this->response; ob_start(); - include ($filename); + include $filename; $type = $response->mapType($response->type()); if (Configure::read('debug') > 0 && $type === 'html') { From 39b7023e756d8e7c84ca4de387a21271183d4695 Mon Sep 17 00:00:00 2001 From: Bryan Crowe Date: Tue, 15 Oct 2013 22:32:46 -0400 Subject: [PATCH 04/51] Change is_null() calls to strict checks --- lib/Cake/Model/Behavior/TreeBehavior.php | 4 ++-- lib/Cake/Network/CakeResponse.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Cake/Model/Behavior/TreeBehavior.php b/lib/Cake/Model/Behavior/TreeBehavior.php index e87abedc3..94c2bb443 100644 --- a/lib/Cake/Model/Behavior/TreeBehavior.php +++ b/lib/Cake/Model/Behavior/TreeBehavior.php @@ -682,7 +682,7 @@ class TreeBehavior extends ModelBehavior { $children = $Model->find('all', $params); $hasChildren = (bool)$children; - if (!is_null($parentId)) { + if ($parentId !== null) { if ($hasChildren) { $Model->updateAll( array($this->settings[$Model->alias]['left'] => $counter), @@ -713,7 +713,7 @@ class TreeBehavior extends ModelBehavior { $children = $Model->find('all', $params); } - if (!is_null($parentId) && $hasChildren) { + if ($parentId !== null && $hasChildren) { $Model->updateAll( array($this->settings[$Model->alias]['right'] => $counter), array($Model->escapeField() => $parentId) diff --git a/lib/Cake/Network/CakeResponse.php b/lib/Cake/Network/CakeResponse.php index 3db176327..bcda4266f 100644 --- a/lib/Cake/Network/CakeResponse.php +++ b/lib/Cake/Network/CakeResponse.php @@ -570,7 +570,7 @@ class CakeResponse { if (is_numeric($header)) { list($header, $value) = array($value, null); } - if (is_null($value)) { + if ($value === null) { list($header, $value) = explode(':', $header, 2); } $this->_headers[$header] = is_array($value) ? array_map('trim', $value) : trim($value); From 5addb2cc9f7d7a6ea7812f4df1e285c09a7fbc56 Mon Sep 17 00:00:00 2001 From: Bryan Crowe Date: Tue, 15 Oct 2013 22:53:04 -0400 Subject: [PATCH 05/51] Change is_null() calls to strict checks in CakeSchema::_arrayDiffAssoc() --- lib/Cake/Model/CakeSchema.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Cake/Model/CakeSchema.php b/lib/Cake/Model/CakeSchema.php index a860108fb..6c4079e65 100644 --- a/lib/Cake/Model/CakeSchema.php +++ b/lib/Cake/Model/CakeSchema.php @@ -551,7 +551,7 @@ class CakeSchema extends Object { continue; } $correspondingValue = $array2[$key]; - if (is_null($value) !== is_null($correspondingValue)) { + if (($value === null ) !== ($correspondingValue === null)) { $difference[$key] = $value; continue; } From bc2fcf421f66f9b986f50e0df176b783f3726063 Mon Sep 17 00:00:00 2001 From: Bryan Crowe Date: Wed, 16 Oct 2013 09:52:29 -0400 Subject: [PATCH 06/51] Remove extra space around the brace in CakeSchema::_arrayDiffAssoc() --- lib/Cake/Model/CakeSchema.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Cake/Model/CakeSchema.php b/lib/Cake/Model/CakeSchema.php index 6c4079e65..7436b6308 100644 --- a/lib/Cake/Model/CakeSchema.php +++ b/lib/Cake/Model/CakeSchema.php @@ -551,7 +551,7 @@ class CakeSchema extends Object { continue; } $correspondingValue = $array2[$key]; - if (($value === null ) !== ($correspondingValue === null)) { + if (($value === null) !== ($correspondingValue === null)) { $difference[$key] = $value; continue; } From 1f2a4113bf4c70092f3ead80677612c7b6b2c524 Mon Sep 17 00:00:00 2001 From: Bryan Crowe Date: Thu, 17 Oct 2013 00:48:17 -0400 Subject: [PATCH 07/51] Readability update for Dispatcher::_invoke() --- lib/Cake/Routing/Dispatcher.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/Cake/Routing/Dispatcher.php b/lib/Cake/Routing/Dispatcher.php index 2ad4efa53..225869ea6 100644 --- a/lib/Cake/Routing/Dispatcher.php +++ b/lib/Cake/Routing/Dispatcher.php @@ -192,9 +192,7 @@ class Dispatcher implements CakeEventListener { if ($render && $controller->autoRender) { $response = $controller->render(); - } elseif (!($result instanceof CakeResponse) && - $response->body() === null - ) { + } elseif (!($result instanceof CakeResponse) && $response->body() === null) { $response->body($result); } $controller->shutdownProcess(); From 935a51c8927fa8274f6e6f8de229c663eb4e1857 Mon Sep 17 00:00:00 2001 From: mark_story Date: Thu, 17 Oct 2013 12:10:40 -0400 Subject: [PATCH 08/51] Add tests for curve<->curves Closes #2148 --- lib/Cake/Test/Case/Utility/InflectorTest.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/Cake/Test/Case/Utility/InflectorTest.php b/lib/Cake/Test/Case/Utility/InflectorTest.php index 00cc702e1..b7b25bd22 100644 --- a/lib/Cake/Test/Case/Utility/InflectorTest.php +++ b/lib/Cake/Test/Case/Utility/InflectorTest.php @@ -121,6 +121,7 @@ class InflectorTest extends CakeTestCase { $this->assertEquals(Inflector::singularize('archives'), 'archive'); $this->assertEquals(Inflector::singularize('briefs'), 'brief'); $this->assertEquals(Inflector::singularize('quotas'), 'quota'); + $this->assertEquals(Inflector::singularize('curves'), 'curve'); $this->assertEquals(Inflector::singularize(''), ''); } @@ -183,6 +184,7 @@ class InflectorTest extends CakeTestCase { $this->assertEquals(Inflector::pluralize('objective'), 'objectives'); $this->assertEquals(Inflector::pluralize('brief'), 'briefs'); $this->assertEquals(Inflector::pluralize('quota'), 'quotas'); + $this->assertEquals(Inflector::pluralize('curve'), 'curves'); $this->assertEquals(Inflector::pluralize(''), ''); } From 1ae470a2841f803e0ee7e9dfa03a8f3132edfaf0 Mon Sep 17 00:00:00 2001 From: mark_story Date: Thu, 17 Oct 2013 12:15:56 -0400 Subject: [PATCH 09/51] Fix inflection rules for curves. Remove curve from the uninflected list and update rules so it, wolves, and lives are still properly handled. Fixes #2148 --- lib/Cake/Test/Case/Utility/InflectorTest.php | 2 ++ lib/Cake/Utility/Inflector.php | 5 ++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/Cake/Test/Case/Utility/InflectorTest.php b/lib/Cake/Test/Case/Utility/InflectorTest.php index b7b25bd22..87e790192 100644 --- a/lib/Cake/Test/Case/Utility/InflectorTest.php +++ b/lib/Cake/Test/Case/Utility/InflectorTest.php @@ -122,6 +122,7 @@ class InflectorTest extends CakeTestCase { $this->assertEquals(Inflector::singularize('briefs'), 'brief'); $this->assertEquals(Inflector::singularize('quotas'), 'quota'); $this->assertEquals(Inflector::singularize('curves'), 'curve'); + $this->assertEquals(Inflector::singularize('body_curves'), 'body_curve'); $this->assertEquals(Inflector::singularize(''), ''); } @@ -185,6 +186,7 @@ class InflectorTest extends CakeTestCase { $this->assertEquals(Inflector::pluralize('brief'), 'briefs'); $this->assertEquals(Inflector::pluralize('quota'), 'quotas'); $this->assertEquals(Inflector::pluralize('curve'), 'curves'); + $this->assertEquals(Inflector::pluralize('body_curve'), 'body_curves'); $this->assertEquals(Inflector::pluralize(''), ''); } diff --git a/lib/Cake/Utility/Inflector.php b/lib/Cake/Utility/Inflector.php index 394b75257..5637d1f22 100644 --- a/lib/Cake/Utility/Inflector.php +++ b/lib/Cake/Utility/Inflector.php @@ -129,8 +129,8 @@ class Inflector { '/(tive)s$/i' => '\1', '/(hive)s$/i' => '\1', '/(drive)s$/i' => '\1', - '/([lre])ves$/i' => '\1f', - '/([^fo])ves$/i' => '\1fe', + '/([le])ves$/i' => '\1f', + '/([^rfo])ves$/i' => '\1fe', '/(^analy)ses$/i' => '\1sis', '/(analy|diagno|^ba|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$/i' => '\1\2sis', '/([ti])a$/i' => '\1um', @@ -148,7 +148,6 @@ class Inflector { 'irregular' => array( 'foes' => 'foe', 'waves' => 'wave', - 'curves' => 'curve' ) ); From bb33d52cc668afe88be80d271b890fed7cb7f354 Mon Sep 17 00:00:00 2001 From: Cameri Date: Thu, 17 Oct 2013 18:26:39 -0400 Subject: [PATCH 10/51] Added 'xhr' as callback in JqueryEngineHelper::request() so it formats as Javascript. --- lib/Cake/View/Helper/JqueryEngineHelper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Cake/View/Helper/JqueryEngineHelper.php b/lib/Cake/View/Helper/JqueryEngineHelper.php index fe5bc77e5..bc3cd92c7 100644 --- a/lib/Cake/View/Helper/JqueryEngineHelper.php +++ b/lib/Cake/View/Helper/JqueryEngineHelper.php @@ -271,7 +271,7 @@ class JqueryEngineHelper extends JsBaseEngineHelper { $options['success'] = $success; unset($options['update']); } - $callbacks = array('success', 'error', 'beforeSend', 'complete'); + $callbacks = array('success', 'error', 'beforeSend', 'complete', 'xhr'); if (!empty($options['dataExpression'])) { $callbacks[] = 'data'; unset($options['dataExpression']); From 069b30924992ae1e970e0740a078500928b18213 Mon Sep 17 00:00:00 2001 From: Cameri Date: Fri, 18 Oct 2013 11:00:15 -0400 Subject: [PATCH 11/51] Added test case for JqueryEngineHelper::request() to validate 'xhr' callback. --- .../Test/Case/View/Helper/JqueryEngineHelperTest.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/Cake/Test/Case/View/Helper/JqueryEngineHelperTest.php b/lib/Cake/Test/Case/View/Helper/JqueryEngineHelperTest.php index 9eb053780..0a3ad13b4 100644 --- a/lib/Cake/Test/Case/View/Helper/JqueryEngineHelperTest.php +++ b/lib/Cake/Test/Case/View/Helper/JqueryEngineHelperTest.php @@ -219,6 +219,17 @@ class JqueryEngineHelperTest extends CakeTestCase { )); $expected = '$.ajax({beforeSend:function (XMLHttpRequest) {doBefore}, data:$("#someId").serialize(), success:function (data, textStatus) {doFoo}, type:"post", url:"\\/people\\/edit\\/1"});'; $this->assertEquals($expected, $result); + + $result = $this->Jquery->request('/people/edit/1', array( + 'success' => 'doFoo', + 'xhr' => 'return jQuery.ajaxSettings.xhr();', + 'async' => true, + 'method' => 'post', + 'dataExpression' => true, + 'data' => '$("#someId").serialize()', + )); + $expected = '$.ajax({async:true, data:$("#someId").serialize(), success:function (data, textStatus) {doFoo}, type:"post", url:"\/mpm\/people\/edit\/1", xhr:function () {return jQuery.ajaxSettings.xhr();}});'; + $this->assertEquals($expected, $result); } /** From 2b234236d643de40c621d859976f22b6f9cd718a Mon Sep 17 00:00:00 2001 From: Cameri Date: Fri, 18 Oct 2013 11:41:38 -0400 Subject: [PATCH 12/51] Removed /mpm from 'url' option for last test in JqueryEngineHelper::testRequest(). --- lib/Cake/Test/Case/View/Helper/JqueryEngineHelperTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Cake/Test/Case/View/Helper/JqueryEngineHelperTest.php b/lib/Cake/Test/Case/View/Helper/JqueryEngineHelperTest.php index 0a3ad13b4..195dece3a 100644 --- a/lib/Cake/Test/Case/View/Helper/JqueryEngineHelperTest.php +++ b/lib/Cake/Test/Case/View/Helper/JqueryEngineHelperTest.php @@ -228,7 +228,7 @@ class JqueryEngineHelperTest extends CakeTestCase { 'dataExpression' => true, 'data' => '$("#someId").serialize()', )); - $expected = '$.ajax({async:true, data:$("#someId").serialize(), success:function (data, textStatus) {doFoo}, type:"post", url:"\/mpm\/people\/edit\/1", xhr:function () {return jQuery.ajaxSettings.xhr();}});'; + $expected = '$.ajax({async:true, data:$("#someId").serialize(), success:function (data, textStatus) {doFoo}, type:"post", url:"\/people\/edit\/1", xhr:function () {return jQuery.ajaxSettings.xhr();}});'; $this->assertEquals($expected, $result); } From c08df2a7f9d44068c7dff988a7eafae49335e5c5 Mon Sep 17 00:00:00 2001 From: euromark Date: Sat, 19 Oct 2013 17:54:43 +0200 Subject: [PATCH 13/51] Correct wording of Hash::expand() --- lib/Cake/Utility/Hash.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Cake/Utility/Hash.php b/lib/Cake/Utility/Hash.php index e12f14c5f..697b3df98 100644 --- a/lib/Cake/Utility/Hash.php +++ b/lib/Cake/Utility/Hash.php @@ -553,7 +553,7 @@ class Hash { } /** - * Expand/unflattens an string to an array + * Expands a flat array to a nested array. * * For example, unflattens an array that was collapsed with `Hash::flatten()` * into a multi-dimensional array. So, `array('0.Foo.Bar' => 'Far')` becomes From bcafde6212a8614d69e9c399197166c67eb0b0d1 Mon Sep 17 00:00:00 2001 From: mark_story Date: Sun, 20 Oct 2013 22:54:30 -0400 Subject: [PATCH 14/51] Add numeric validator for float fields by default. Make bake add numeric validator to float fields. Fixes #2163 --- lib/Cake/Console/Command/Task/ModelTask.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/Cake/Console/Command/Task/ModelTask.php b/lib/Cake/Console/Command/Task/ModelTask.php index 27e1a0960..8ed2b2ea0 100644 --- a/lib/Cake/Console/Command/Task/ModelTask.php +++ b/lib/Cake/Console/Command/Task/ModelTask.php @@ -438,6 +438,8 @@ class ModelTask extends BakeTask { $guess = $methods['notEmpty']; } elseif ($metaData['type'] === 'integer') { $guess = $methods['numeric']; + } elseif ($metaData['type'] === 'float') { + $guess = $methods['numeric']; } elseif ($metaData['type'] === 'boolean') { $guess = $methods['boolean']; } elseif ($metaData['type'] === 'date') { From e27e8877078cf57d115e85191b7aea64c00857d5 Mon Sep 17 00:00:00 2001 From: mark_story Date: Mon, 21 Oct 2013 16:55:21 -0400 Subject: [PATCH 15/51] Deprecate features being removed in 3.0 --- lib/Cake/View/Helper.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/Cake/View/Helper.php b/lib/Cake/View/Helper.php index 455d89b2a..6f9a5801f 100644 --- a/lib/Cake/View/Helper.php +++ b/lib/Cake/View/Helper.php @@ -196,6 +196,7 @@ class Helper extends Object { * * @param string $name Name of the property being accessed. * @return mixed Helper or property found at $name + * @deprecated Accessing request properties through this method is deprecated and will be removed in 3.0. */ public function __get($name) { if (isset($this->_helperMap[$name]) && !isset($this->{$name})) { @@ -224,6 +225,7 @@ class Helper extends Object { * @param string $name Name of the property being accessed. * @param mixed $value * @return void + * @deprecated This method will be removed in 3.0 */ public function __set($name, $value) { switch ($name) { @@ -404,6 +406,7 @@ class Helper extends Object { * * @param string|array $output Either an array of strings to clean or a single string to clean. * @return string|array cleaned content for output + * @deprecated This method will be removed in 3.0 */ public function clean($output) { $this->_reset(); From d39ced83810eb4055ad2c0c9b5b459a2a03315c6 Mon Sep 17 00:00:00 2001 From: Bryan Crowe Date: Tue, 22 Oct 2013 00:09:34 -0400 Subject: [PATCH 16/51] Correct 'an URL' to 'a URL' in docblocks --- lib/Cake/Controller/Component/AuthComponent.php | 6 +++--- lib/Cake/Network/Http/HttpSocket.php | 6 +++--- lib/Cake/Routing/Route/CakeRoute.php | 8 ++++---- lib/Cake/Routing/Route/RedirectRoute.php | 2 +- lib/Cake/Routing/Router.php | 14 +++++++------- lib/Cake/Utility/Xml.php | 2 +- lib/Cake/View/Helper.php | 4 ++-- lib/Cake/View/Helper/FormHelper.php | 2 +- lib/Cake/View/Helper/JsBaseEngineHelper.php | 2 +- 9 files changed, 23 insertions(+), 23 deletions(-) diff --git a/lib/Cake/Controller/Component/AuthComponent.php b/lib/Cake/Controller/Component/AuthComponent.php index 46db0f3a7..e33ca8b1a 100644 --- a/lib/Cake/Controller/Component/AuthComponent.php +++ b/lib/Cake/Controller/Component/AuthComponent.php @@ -174,7 +174,7 @@ class AuthComponent extends Component { protected static $_user = array(); /** - * An URL (defined as a string or array) to the controller action that handles + * A URL (defined as a string or array) to the controller action that handles * logins. Defaults to `/users/login`. * * @var mixed @@ -220,7 +220,7 @@ class AuthComponent extends Component { * Controls handling of unauthorized access. * - For default value `true` unauthorized user is redirected to the referrer URL * or AuthComponent::$loginRedirect or '/'. - * - If set to a string or array the value is used as an URL to redirect to. + * - If set to a string or array the value is used as a URL to redirect to. * - If set to false a ForbiddenException exception is thrown instead of redirecting. * * @var mixed @@ -699,7 +699,7 @@ class AuthComponent extends Component { /** * Get the URL a user should be redirected to upon login. * - * Pass an URL in to set the destination a user should be redirected to upon + * Pass a URL in to set the destination a user should be redirected to upon * logging in. * * If no parameter is passed, gets the authentication redirect URL. The URL diff --git a/lib/Cake/Network/Http/HttpSocket.php b/lib/Cake/Network/Http/HttpSocket.php index 858887c6f..12bd5c329 100644 --- a/lib/Cake/Network/Http/HttpSocket.php +++ b/lib/Cake/Network/Http/HttpSocket.php @@ -134,7 +134,7 @@ class HttpSocket extends CakeSocket { /** * Build an HTTP Socket using the specified configuration. * - * You can use an URL string to set the URL and use default configurations for + * You can use a URL string to set the URL and use default configurations for * all other options: * * `$http = new HttpSocket('http://cakephp.org/');` @@ -464,7 +464,7 @@ class HttpSocket extends CakeSocket { /** * Issues a POST request to the specified URI, query, and request. * - * `post()` can be used to post simple data arrays to an URL: + * `post()` can be used to post simple data arrays to a URL: * * {{{ * $response = $http->post('http://example.com', array( @@ -545,7 +545,7 @@ class HttpSocket extends CakeSocket { * * Would return `/search?q=socket`. * - * @param string|array Either a string or array of URL options to create an URL with. + * @param string|array Either a string or array of URL options to create a URL with. * @param string $uriTemplate A template string to use for URL formatting. * @return mixed Either false on failure or a string containing the composed URL. */ diff --git a/lib/Cake/Routing/Route/CakeRoute.php b/lib/Cake/Routing/Route/CakeRoute.php index 72886003b..88d094f66 100644 --- a/lib/Cake/Routing/Route/CakeRoute.php +++ b/lib/Cake/Routing/Route/CakeRoute.php @@ -369,9 +369,9 @@ class CakeRoute { } /** - * Apply persistent parameters to an URL array. Persistent parameters are a special + * Apply persistent parameters to a URL array. Persistent parameters are a special * key used during route creation to force route parameters to persist when omitted from - * an URL array. + * a URL array. * * @param array $url The array to apply persistent parameters to. * @param array $params An array of persistent values to replace persistent ones. @@ -390,7 +390,7 @@ class CakeRoute { } /** - * Check if an URL array matches this route instance. + * Check if a URL array matches this route instance. * * If the URL matches the route parameters and settings, then * return a generated string URL. If the URL doesn't match the route parameters, false will be returned. @@ -485,7 +485,7 @@ class CakeRoute { } /** - * Converts a matching route array into an URL string. + * Converts a matching route array into a URL string. * * Composes the string URL using the template * used to create the route. diff --git a/lib/Cake/Routing/Route/RedirectRoute.php b/lib/Cake/Routing/Route/RedirectRoute.php index f0ac73f44..322d276ed 100644 --- a/lib/Cake/Routing/Route/RedirectRoute.php +++ b/lib/Cake/Routing/Route/RedirectRoute.php @@ -41,7 +41,7 @@ class RedirectRoute extends CakeRoute { public $redirect; /** - * Flag for disabling exit() when this route parses an URL. + * Flag for disabling exit() when this route parses a URL. * * @var boolean */ diff --git a/lib/Cake/Routing/Router.php b/lib/Cake/Routing/Router.php index 26f6f82c9..3c9f15bef 100644 --- a/lib/Cake/Routing/Router.php +++ b/lib/Cake/Routing/Router.php @@ -80,7 +80,7 @@ class Router { protected static $_parseExtensions = false; /** - * List of valid extensions to parse from an URL. If null, any extension is allowed. + * List of valid extensions to parse from a URL. If null, any extension is allowed. * * @var array */ @@ -278,7 +278,7 @@ class Router { * - `pass` is used to define which of the routed parameters should be shifted into the pass array. Adding a * parameter to pass will remove it from the regular route array. Ex. `'pass' => array('slug')` * - `persist` is used to define which route parameters should be automatically included when generating - * new URLs. You can override persistent parameters by redefining them in an URL or remove them by + * new URLs. You can override persistent parameters by redefining them in a URL or remove them by * setting the parameter to `false`. Ex. `'persist' => array('lang')` * - `routeClass` is used to extend and change how individual routes parse requests and handle reverse routing, * via a custom routing class. Ex. `'routeClass' => 'SlugRoute'` @@ -359,7 +359,7 @@ class Router { * `Router::redirect('/home/*', array('controller' => 'posts', 'action' => 'view'), array('persist' => true));` * * Redirects /home/* to /posts/view and passes the parameters to /posts/view. Using an array as the - * redirect destination allows you to use other routes to define where an URL string should be redirected to. + * redirect destination allows you to use other routes to define where a URL string should be redirected to. * * `Router::redirect('/posts/*', 'http://google.com', array('status' => 302));` * @@ -589,7 +589,7 @@ class Router { } /** - * Parses a file extension out of an URL, if Router::parseExtensions() is enabled. + * Parses a file extension out of a URL, if Router::parseExtensions() is enabled. * * @param string $url * @return array Returns an array containing the altered URL and the parsed extension. @@ -758,7 +758,7 @@ class Router { /** * Finds URL for specified action. * - * Returns an URL pointing to a combination of controller and action. Param + * Returns a URL pointing to a combination of controller and action. Param * $url can be: * * - Empty - the method will find address to actual controller/action. @@ -938,7 +938,7 @@ class Router { * A special fallback method that handles URL arrays that cannot match * any defined routes. * - * @param array $url An URL that didn't match any routes + * @param array $url A URL that didn't match any routes * @return string A generated URL for the array * @see Router::url() */ @@ -1085,7 +1085,7 @@ class Router { } /** - * Normalizes an URL for purposes of comparison. + * Normalizes a URL for purposes of comparison. * * Will strip the base path off and replace any double /'s. * It will not unify the casing and underscoring of the input value. diff --git a/lib/Cake/Utility/Xml.php b/lib/Cake/Utility/Xml.php index d4fae2225..dbebf7274 100644 --- a/lib/Cake/Utility/Xml.php +++ b/lib/Cake/Utility/Xml.php @@ -81,7 +81,7 @@ class Xml { * is disabled by default for security reasons. * - If using array as input, you can pass `options` from Xml::fromArray. * - * @param string|array $input XML string, a path to a file, an URL or an array + * @param string|array $input XML string, a path to a file, a URL or an array * @param array $options The options to use * @return SimpleXMLElement|DOMDocument SimpleXMLElement or DOMDocument * @throws XmlException diff --git a/lib/Cake/View/Helper.php b/lib/Cake/View/Helper.php index 6f9a5801f..898f2445c 100644 --- a/lib/Cake/View/Helper.php +++ b/lib/Cake/View/Helper.php @@ -245,7 +245,7 @@ class Helper extends Object { /** * Finds URL for specified action. * - * Returns an URL pointing at the provided parameters. + * Returns a URL pointing at the provided parameters. * * @param string|array $url Either a relative string url like `/products/view/23` or * an array of URL parameters. Using an array for URLs will allow you to leverage @@ -341,7 +341,7 @@ class Helper extends Object { } /** - * Encodes an URL for use in HTML attributes. + * Encodes a URL for use in HTML attributes. * * @param string $url The URL to encode. * @return string The URL encoded for both URL & HTML contexts. diff --git a/lib/Cake/View/Helper/FormHelper.php b/lib/Cake/View/Helper/FormHelper.php index 709c4d0b1..116aa8718 100644 --- a/lib/Cake/View/Helper/FormHelper.php +++ b/lib/Cake/View/Helper/FormHelper.php @@ -297,7 +297,7 @@ class FormHelper extends AppHelper { * * - `type` Form method defaults to POST * - `action` The controller action the form submits to, (optional). - * - `url` The URL the form submits to. Can be a string or an URL array. If you use 'url' + * - `url` The URL the form submits to. Can be a string or a URL array. If you use 'url' * you should leave 'action' undefined. * - `default` Allows for the creation of Ajax forms. Set this to false to prevent the default event handler. * Will create an onsubmit attribute if it doesn't not exist. If it does, default action suppression diff --git a/lib/Cake/View/Helper/JsBaseEngineHelper.php b/lib/Cake/View/Helper/JsBaseEngineHelper.php index 29aeba971..a3bfaa514 100644 --- a/lib/Cake/View/Helper/JsBaseEngineHelper.php +++ b/lib/Cake/View/Helper/JsBaseEngineHelper.php @@ -67,7 +67,7 @@ abstract class JsBaseEngineHelper extends AppHelper { } /** - * Redirects to an URL. Creates a window.location modification snippet + * Redirects to a URL. Creates a window.location modification snippet * that can be used to trigger 'redirects' from JavaScript. * * @param string|array $url URL From ab89f6ec97e0574995a344fcf900efdf4c9550fe Mon Sep 17 00:00:00 2001 From: Frank de Graaf Date: Tue, 22 Oct 2013 14:29:36 +0200 Subject: [PATCH 17/51] Makes DboSource less string dependent. --- lib/Cake/Model/Datasource/DboSource.php | 8 ++++---- .../Test/Case/Model/Datasource/Database/MysqlTest.php | 2 +- lib/Cake/Test/Case/Model/Datasource/DboSourceTest.php | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/Cake/Model/Datasource/DboSource.php b/lib/Cake/Model/Datasource/DboSource.php index c3b109dab..ac2d29593 100644 --- a/lib/Cake/Model/Datasource/DboSource.php +++ b/lib/Cake/Model/Datasource/DboSource.php @@ -1072,7 +1072,7 @@ class DboSource extends DataSource { } } - $query = trim($this->generateAssociationQuery($model, null, null, null, null, $queryData, false, $null)); + $query = $this->generateAssociationQuery($model, null, null, null, null, $queryData, false, $null); $resultSet = $this->fetchAll($query, $model->cacheQueries); @@ -1749,19 +1749,19 @@ class DboSource extends DataSource { switch (strtolower($type)) { case 'select': - return "SELECT {$fields} FROM {$table} {$alias} {$joins} {$conditions} {$group} {$order} {$limit}"; + return trim("SELECT {$fields} FROM {$table} {$alias} {$joins} {$conditions} {$group} {$order} {$limit}"); case 'create': return "INSERT INTO {$table} ({$fields}) VALUES ({$values})"; case 'update': if (!empty($alias)) { $aliases = "{$this->alias}{$alias} {$joins} "; } - return "UPDATE {$table} {$aliases}SET {$fields} {$conditions}"; + return trim("UPDATE {$table} {$aliases}SET {$fields} {$conditions}"); case 'delete': if (!empty($alias)) { $aliases = "{$this->alias}{$alias} {$joins} "; } - return "DELETE {$alias} FROM {$table} {$aliases}{$conditions}"; + return trim("DELETE {$alias} FROM {$table} {$aliases}{$conditions}"); case 'schema': foreach (array('columns', 'indexes', 'tableParameters') as $var) { if (is_array(${$var})) { diff --git a/lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php b/lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php index 09c7d221c..3e8b2512b 100644 --- a/lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php +++ b/lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php @@ -1198,7 +1198,7 @@ class MysqlTest extends CakeTestCase { $this->assertRegExp('/^SELECT\s+`TestModel4`\.`id`, `TestModel4`\.`name`, `TestModel4`\.`created`, `TestModel4`\.`updated`, `TestModel4Parent`\.`id`, `TestModel4Parent`\.`name`, `TestModel4Parent`\.`created`, `TestModel4Parent`\.`updated`\s+/', $result); $this->assertRegExp('/FROM\s+\S+`test_model4` AS `TestModel4`\s+LEFT JOIN\s+\S+`test_model4` AS `TestModel4Parent`/', $result); $this->assertRegExp('/\s+ON\s+\(`TestModel4`.`parent_id` = `TestModel4Parent`.`id`\)\s+WHERE/', $result); - $this->assertRegExp('/\s+WHERE\s+1 = 1\s+$/', $result); + $this->assertRegExp('/\s+WHERE\s+1 = 1$/', $result); $params['assocData']['type'] = 'INNER'; $this->Model->belongsTo['TestModel4Parent']['type'] = 'INNER'; diff --git a/lib/Cake/Test/Case/Model/Datasource/DboSourceTest.php b/lib/Cake/Test/Case/Model/Datasource/DboSourceTest.php index 5fb214ce7..944266af3 100644 --- a/lib/Cake/Test/Case/Model/Datasource/DboSourceTest.php +++ b/lib/Cake/Test/Case/Model/Datasource/DboSourceTest.php @@ -1143,7 +1143,7 @@ class DboSourceTest extends CakeTestCase { ), $this->Model ); - $expected = 'SELECT DISTINCT(AssetsTag.asset_id) FROM assets_tags AS AssetsTag WHERE Tag.name = foo bar GROUP BY AssetsTag.asset_id '; + $expected = 'SELECT DISTINCT(AssetsTag.asset_id) FROM assets_tags AS AssetsTag WHERE Tag.name = foo bar GROUP BY AssetsTag.asset_id'; $this->assertEquals($expected, $subQuery); } From 75624c02793f7452d255418b888da3842efd66e8 Mon Sep 17 00:00:00 2001 From: mark_story Date: Tue, 22 Oct 2013 21:49:25 -0400 Subject: [PATCH 18/51] Update version number to 2.4.2 --- lib/Cake/VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Cake/VERSION.txt b/lib/Cake/VERSION.txt index fdd823fce..e48fe92cd 100644 --- a/lib/Cake/VERSION.txt +++ b/lib/Cake/VERSION.txt @@ -17,4 +17,4 @@ // @license http://www.opensource.org/licenses/mit-license.php MIT License // +--------------------------------------------------------------------------------------------+ // //////////////////////////////////////////////////////////////////////////////////////////////////// -2.4.1 +2.4.2 From 79846d25f8c820108284533c24df682a75157d47 Mon Sep 17 00:00:00 2001 From: Bryan Crowe Date: Tue, 22 Oct 2013 22:11:02 -0400 Subject: [PATCH 19/51] Strict null check on group parameter --- lib/Cake/Cache/Cache.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Cake/Cache/Cache.php b/lib/Cake/Cache/Cache.php index c7c593916..61835f191 100644 --- a/lib/Cake/Cache/Cache.php +++ b/lib/Cake/Cache/Cache.php @@ -533,7 +533,7 @@ class Cache { * @throws CacheException */ public static function groupConfigs($group = null) { - if ($group == null) { + if ($group === null) { return self::$_groups; } if (isset(self::$_groups[$group])) { From 328fcdc3768b91ef621830131dabc26704f60fb0 Mon Sep 17 00:00:00 2001 From: mark_story Date: Tue, 22 Oct 2013 22:18:59 -0400 Subject: [PATCH 20/51] Sync skel and app directories. Closes #1698 --- app/Config/database.php.default | 20 +++++++++---------- app/Config/email.php.default | 16 ++++++++------- app/Console/cake.php | 1 + app/webroot/index.php | 2 +- .../Templates/skel/Config/bootstrap.php | 6 +++--- .../Console/Templates/skel/Config/core.php | 2 +- .../skel/Config/database.php.default | 18 +++++++++-------- .../Templates/skel/View/Layouts/flash.ctp | 6 +++--- .../skel/View/Layouts/rss/default.ctp | 9 ++++----- 9 files changed, 42 insertions(+), 38 deletions(-) diff --git a/app/Config/database.php.default b/app/Config/database.php.default index 47613acf1..01e3442c0 100644 --- a/app/Config/database.php.default +++ b/app/Config/database.php.default @@ -1,9 +1,5 @@ The name of a supported datasource; valid options are as follows: - * Database/Mysql - MySQL 4 & 5, - * Database/Sqlite - SQLite (PHP5 only), - * Database/Postgres - PostgreSQL 7 and higher, - * Database/Sqlserver - Microsoft SQL Server 2005 and higher + * Database/Mysql - MySQL 4 & 5, + * Database/Sqlite - SQLite (PHP5 only), + * Database/Postgres - PostgreSQL 7 and higher, + * Database/Sqlserver - Microsoft SQL Server 2005 and higher * * You can add custom database datasources (or override existing datasources) by adding the * appropriate file to app/Model/Datasource/Database. Datasources should be named 'MyDatasource.php', @@ -43,7 +42,8 @@ * on a per-table basis with the Model::$tablePrefix property. * * schema => - * For Postgres/Sqlserver specifies which schema you would like to use the tables in. Postgres defaults to 'public'. For Sqlserver, it defaults to empty and use + * For Postgres/Sqlserver specifies which schema you would like to use the tables in. + * Postgres defaults to 'public'. For Sqlserver, it defaults to empty and use * the connected user's default schema (typically 'dbo'). * * encoding => diff --git a/app/Config/email.php.default b/app/Config/email.php.default index 717a45860..6e784170b 100644 --- a/app/Config/email.php.default +++ b/app/Config/email.php.default @@ -1,9 +1,5 @@ The name of a supported transport; valid options are as follows: - * Mail - Send using PHP mail function - * Smtp - Send using SMTP - * Debug - Do not send the email, just return the result + * Mail - Send using PHP mail function + * Smtp - Send using SMTP + * Debug - Do not send the email, just return the result * * You can add custom transports (or override existing transports) by adding the * appropriate file to app/Network/Email. Transports should be named 'YourTransport.php', diff --git a/app/Console/cake.php b/app/Console/cake.php index 3e24579b7..fa81cebb9 100644 --- a/app/Console/cake.php +++ b/app/Console/cake.php @@ -18,6 +18,7 @@ * @since CakePHP(tm) v 2.0 * @license http://www.opensource.org/licenses/mit-license.php MIT License */ + $ds = DIRECTORY_SEPARATOR; $dispatcher = 'Cake' . $ds . 'Console' . $ds . 'ShellDispatcher.php'; diff --git a/app/webroot/index.php b/app/webroot/index.php index cda5040c1..e4192dc58 100644 --- a/app/webroot/index.php +++ b/app/webroot/index.php @@ -78,7 +78,7 @@ if (!defined('WWW_ROOT')) { } // for built-in server -if (php_sapi_name() == 'cli-server') { +if (php_sapi_name() === 'cli-server') { if ($_SERVER['REQUEST_URI'] !== '/' && file_exists(WWW_ROOT . $_SERVER['PHP_SELF'])) { return false; } diff --git a/lib/Cake/Console/Templates/skel/Config/bootstrap.php b/lib/Cake/Console/Templates/skel/Config/bootstrap.php index 99375397e..74028d8ee 100644 --- a/lib/Cake/Console/Templates/skel/Config/bootstrap.php +++ b/lib/Cake/Console/Templates/skel/Config/bootstrap.php @@ -45,7 +45,7 @@ Cache::config('default', array('engine' => 'File')); */ /** - * Custom Inflector rules, can be set to correctly pluralize or singularize table, model, controller names or whatever other + * Custom Inflector rules can be set to correctly pluralize or singularize table, model, controller names or whatever other * string is passed to the inflection functions * * Inflector::rules('singular', array('rules' => array(), 'irregular' => array(), 'uninflected' => array())); @@ -55,7 +55,7 @@ Cache::config('default', array('engine' => 'File')); /** * Plugins need to be loaded manually, you can either load them one by one or all of them in a single call - * Uncomment one of the lines below, as you need. make sure you read the documentation on CakePlugin to use more + * Uncomment one of the lines below, as you need. Make sure you read the documentation on CakePlugin to use more * advanced ways of loading plugins * * CakePlugin::loadAll(); // Loads all plugins at once @@ -64,7 +64,7 @@ Cache::config('default', array('engine' => 'File')); */ /** - * You can attach event listeners to the request lifecycle as Dispatcher Filter . By Default CakePHP bundles two filters: + * You can attach event listeners to the request lifecycle as Dispatcher Filter . By default CakePHP bundles two filters: * * - AssetDispatcher filter will serve your asset files (css, images, js, etc) from your themes and plugins * - CacheDispatcher filter will read the Cache.check configure variable and try to serve cached content generated from controllers diff --git a/lib/Cake/Console/Templates/skel/Config/core.php b/lib/Cake/Console/Templates/skel/Config/core.php index b867453ae..1bb1f5a85 100644 --- a/lib/Cake/Console/Templates/skel/Config/core.php +++ b/lib/Cake/Console/Templates/skel/Config/core.php @@ -61,7 +61,7 @@ * - `renderer` - string - The class responsible for rendering uncaught exceptions. If you choose a custom class you * should place the file for that class in app/Lib/Error. This class needs to implement a render method. * - `log` - boolean - Should Exceptions be logged? - * - `skipLog` - array - list of exceptions to skip for logging. Exceptions that + * - `skipLog` - array - list of exceptions to skip for logging. Exceptions that * extend one of the listed exceptions will also be skipped for logging. * Example: `'skipLog' => array('NotFoundException', 'UnauthorizedException')` * diff --git a/lib/Cake/Console/Templates/skel/Config/database.php.default b/lib/Cake/Console/Templates/skel/Config/database.php.default index a124e9ddd..4b679f473 100644 --- a/lib/Cake/Console/Templates/skel/Config/database.php.default +++ b/lib/Cake/Console/Templates/skel/Config/database.php.default @@ -1,9 +1,5 @@ The name of a supported datasource; valid options are as follows: - * Database/Mysql - MySQL 4 & 5, - * Database/Sqlite - SQLite (PHP5 only), - * Database/Postgres - PostgreSQL 7 and higher, - * Database/Sqlserver - Microsoft SQL Server 2005 and higher + * Database/Mysql - MySQL 4 & 5, + * Database/Sqlite - SQLite (PHP5 only), + * Database/Postgres - PostgreSQL 7 and higher, + * Database/Sqlserver - Microsoft SQL Server 2005 and higher * * You can add custom database datasources (or override existing datasources) by adding the * appropriate file to app/Model/Datasource/Database. Datasources should be named 'MyDatasource.php', @@ -45,6 +41,12 @@ * * unix_socket => * For MySQL to connect via socket specify the `unix_socket` parameter instead of `host` and `port` + + * settings => + * Array of key/value pairs, on connection it executes SET statements for each pair + * For MySQL : http://dev.mysql.com/doc/refman/5.6/en/set-statement.html + * For Postgres : http://www.postgresql.org/docs/9.2/static/sql-set.html + * For Sql Server : http://msdn.microsoft.com/en-us/library/ms190356.aspx */ class DATABASE_CONFIG { diff --git a/lib/Cake/Console/Templates/skel/View/Layouts/flash.ctp b/lib/Cake/Console/Templates/skel/View/Layouts/flash.ctp index 72047d40f..eaf6caf98 100644 --- a/lib/Cake/Console/Templates/skel/View/Layouts/flash.ctp +++ b/lib/Cake/Console/Templates/skel/View/Layouts/flash.ctp @@ -14,9 +14,9 @@ Html->charset(); ?> <?php echo $page_title; ?> - + - +