Permalink
Browse files

Merge remote-tracking branch 'origin/2.2' into 2.2

  • Loading branch information...
lorenzo committed Apr 24, 2012
2 parents 63c0c2c + 7e38f9d commit e7a7a177cc98311bc2974babaf326d92dac1254b
Showing with 719 additions and 577 deletions.
  1. +18 −11 app/Config/bootstrap.php
  2. +1 −1 app/View/Layouts/ajax.ctp
  3. +1 −1 app/View/Layouts/js/default.ctp
  4. +2 −2 app/View/Layouts/rss/default.ctp
  5. +1 −1 app/View/Layouts/xml/default.ctp
  6. +5 −5 lib/Cake/Cache/CacheEngine.php
  7. +3 −3 lib/Cake/Cache/Engine/RedisEngine.php
  8. +3 −1 lib/Cake/Console/Command/Task/ExtractTask.php
  9. +19 −12 lib/Cake/Console/Templates/skel/Config/bootstrap.php
  10. +2 −2 lib/Cake/Console/Templates/skel/View/Layouts/Emails/html/default.ctp
  11. +1 −1 lib/Cake/Console/Templates/skel/View/Layouts/Emails/text/default.ctp
  12. +1 −1 lib/Cake/Console/Templates/skel/View/Layouts/ajax.ctp
  13. +1 −1 lib/Cake/Console/Templates/skel/View/Layouts/js/default.ctp
  14. +2 −2 lib/Cake/Console/Templates/skel/View/Layouts/rss/default.ctp
  15. +1 −1 lib/Cake/Console/Templates/skel/View/Layouts/xml/default.ctp
  16. +1 −26 lib/Cake/Controller/Component/EmailComponent.php
  17. +9 −20 lib/Cake/Model/Datasource/Database/Mysql.php
  18. +9 −11 lib/Cake/Model/Datasource/Database/Postgres.php
  19. +9 −0 lib/Cake/Model/Datasource/Database/Sqlite.php
  20. +1 −21 lib/Cake/Model/Datasource/Database/Sqlserver.php
  21. +109 −33 lib/Cake/Model/Datasource/DboSource.php
  22. +1 −1 lib/Cake/Model/Model.php
  23. +25 −15 lib/Cake/Network/CakeRequest.php
  24. +5 −4 lib/Cake/Routing/Dispatcher.php
  25. +6 −10 lib/Cake/Routing/Filter/CacheDispatcher.php
  26. +2 −1 lib/Cake/Routing/Router.php
  27. +1 −1 lib/Cake/Test/Case/Cache/Engine/FileEngineTest.php
  28. +1 −2 lib/Cake/Test/Case/Cache/Engine/RedisEngineTest.php
  29. +1 −2 lib/Cake/Test/Case/Controller/Component/Auth/FormAuthenticateTest.php
  30. +18 −0 lib/Cake/Test/Case/Controller/Component/EmailComponentTest.php
  31. +35 −1 lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php
  32. +33 −0 lib/Cake/Test/Case/Model/Datasource/Database/PostgresTest.php
  33. +33 −0 lib/Cake/Test/Case/Model/Datasource/Database/SqliteTest.php
  34. +79 −0 lib/Cake/Test/Case/Model/Datasource/DboSourceTest.php
  35. +1 −2 lib/Cake/Test/Case/Model/ModelIntegrationTest.php
  36. +71 −90 lib/Cake/Test/Case/Model/ModelWriteTest.php
  37. +98 −94 lib/Cake/Test/Case/Network/CakeRequestTest.php
  38. +6 −9 lib/Cake/Test/Case/Routing/DispatcherTest.php
  39. +6 −10 lib/Cake/Test/Case/Routing/Filter/AssetDispatcherTest.php
  40. +23 −0 lib/Cake/Test/Case/TestSuite/CakeTestSuiteTest.php
  41. +1 −0 lib/Cake/Test/Case/Utility/InflectorTest.php
  42. +2 −120 lib/Cake/Test/Case/View/Helper/FormHelperTest.php
  43. +0 −54 lib/Cake/Test/Case/View/Helper/HtmlHelperTest.php
  44. +10 −0 lib/Cake/TestSuite/CakeTestCase.php
  45. +6 −2 lib/Cake/TestSuite/CakeTestSuite.php
  46. +26 −0 lib/Cake/TestSuite/CakeTestSuiteDispatcher.php
  47. +14 −1 lib/Cake/TestSuite/Fixture/CakeTestModel.php
  48. +12 −0 lib/Cake/TestSuite/Reporter/CakeHtmlReporter.php
  49. +1 −1 lib/Cake/Utility/Inflector.php
  50. +3 −1 lib/Cake/View/HelperCollection.php
View
@@ -89,17 +89,24 @@
* The settings below can be used to set additional paths to models, views and controllers.
*
* App::build(array(
- * 'Plugin' => array('/full/path/to/plugins/', '/next/full/path/to/plugins/'),
- * 'Model' => array('/full/path/to/models/', '/next/full/path/to/models/'),
- * 'View' => array('/full/path/to/views/', '/next/full/path/to/views/'),
- * 'Controller' => array('/full/path/to/controllers/', '/next/full/path/to/controllers/'),
- * 'Model/Datasource' => array('/full/path/to/datasources/', '/next/full/path/to/datasources/'),
- * 'Model/Behavior' => array('/full/path/to/behaviors/', '/next/full/path/to/behaviors/'),
- * 'Controller/Component' => array('/full/path/to/components/', '/next/full/path/to/components/'),
- * 'View/Helper' => array('/full/path/to/helpers/', '/next/full/path/to/helpers/'),
- * 'Vendor' => array('/full/path/to/vendors/', '/next/full/path/to/vendors/'),
- * 'Console/Command' => array('/full/path/to/shells/', '/next/full/path/to/shells/'),
- * 'Locale' => array('/full/path/to/locale/', '/next/full/path/to/locale/')
+ * 'Model' => array('/path/to/models', '/next/path/to/models'),
+ * 'Model/Behavior' => array('/path/to/behaviors', '/next/path/to/behaviors'),
+ * 'Model/Datasource' => array('/path/to/datasources', '/next/path/to/datasources'),
+ * 'Model/Datasource/Database' => array('/path/to/databases', '/next/path/to/database'),
+ * 'Model/Datasource/Session' => array('/path/to/sessions', '/next/path/to/sessions'),
+ * 'Controller' => array('/path/to/controllers', '/next/path/to/controllers'),
+ * 'Controller/Component' => array('/path/to/components', '/next/path/to/components'),
+ * 'Controller/Component/Auth' => array('/path/to/auths', '/next/path/to/auths'),
+ * 'Controller/Component/Acl' => array('/path/to/acls', '/next/path/to/acls'),
+ * 'View' => array('/path/to/views', '/next/path/to/views'),
+ * 'View/Helper' => array('/path/to/helpers', '/next/path/to/helpers'),
+ * 'Console' => array('/path/to/consoles', '/next/path/to/consoles'),
+ * 'Console/Command' => array('/path/to/commands', '/next/path/to/commands'),
+ * 'Console/Command/Task' => array('/path/to/tasks', '/next/path/to/tasks'),
+ * 'Lib' => array('/path/to/libs', '/next/path/to/libs'),
+ * 'Locale' => array('/path/to/locales', '/next/path/to/locales'),
+ * 'Vendor' => array('/path/to/vendors', '/next/path/to/vendors'),
+ * 'Plugin' => array('/path/to/plugins', '/next/path/to/plugins'),
* ));
*
*/
@@ -16,4 +16,4 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
?>
-<?php echo $content_for_layout; ?>
+<?php echo $this->fetch('content'); ?>
@@ -1,2 +1,2 @@
<?php echo $scripts_for_layout; ?>
-<script type="text/javascript"><?php echo $content_for_layout; ?></script>
+<script type="text/javascript"><?php echo $this->fetch('content'); ?></script>
@@ -8,7 +8,7 @@ if (!isset($channel['title'])) {
echo $this->Rss->document(
$this->Rss->channel(
- array(), $channel, $content_for_layout
+ array(), $channel, $this->fetch('content')
)
);
-?>
+?>
@@ -1 +1 @@
-<?php echo $content_for_layout; ?>
+<?php echo $this->fetch('content'); ?>
@@ -129,7 +129,7 @@ public function gc($expires = null) {
*
* @param string $groups name of the group to be cleared
* @return boolean
- **/
+ */
public function clearGroup($group) {
return false;
}
@@ -140,10 +140,10 @@ public function clearGroup($group) {
* the token representing each group in the cache key
*
* @return array
- **/
- public function groups() {
- return $this->settings['groups'];
- }
+ */
+ public function groups() {
+ return $this->settings['groups'];
+ }
/**
* Cache Engine settings
@@ -115,7 +115,7 @@ public function write($key, $value, $duration) {
public function read($key) {
$value = $this->_Redis->get($key);
if (ctype_digit($value)) {
- $value = (int) $value;
+ $value = (int)$value;
}
if ($value !== false && is_string($value)) {
$value = unserialize($value);
@@ -132,7 +132,7 @@ public function read($key) {
* @throws CacheException when you try to increment with compress = true
*/
public function increment($key, $offset = 1) {
- return (int) $this->_Redis->incrBy($key, $offset);
+ return (int)$this->_Redis->incrBy($key, $offset);
}
/**
@@ -144,7 +144,7 @@ public function increment($key, $offset = 1) {
* @throws CacheException when you try to decrement with compress = true
*/
public function decrement($key, $offset = 1) {
- return (int) $this->_Redis->decrBy($key, $offset);
+ return (int)$this->_Redis->decrBy($key, $offset);
}
/**
@@ -464,6 +464,8 @@ protected function _processValidationRules($field, $rules, $file, $domain) {
* @return void
*/
protected function _buildFiles() {
+ $paths = $this->_paths;
+ $paths[] = realpath(APP) . DS;
foreach ($this->_translations as $domain => $translations) {
foreach ($translations as $msgid => $details) {
$plural = $details['msgid_plural'];
@@ -474,7 +476,7 @@ protected function _buildFiles() {
$occurrences[] = $file . ':' . implode(';', $lines);
}
$occurrences = implode("\n#: ", $occurrences);
- $header = '#: ' . str_replace($this->_paths, '', $occurrences) . "\n";
+ $header = '#: ' . str_replace($paths, '', $occurrences) . "\n";
if ($plural === false) {
$sentence = "msgid \"{$msgid}\"\n";
@@ -30,17 +30,24 @@
* The settings below can be used to set additional paths to models, views and controllers.
*
* App::build(array(
- * 'Plugin' => array('/full/path/to/plugins/', '/next/full/path/to/plugins/'),
- * 'Model' => array('/full/path/to/models/', '/next/full/path/to/models/'),
- * 'View' => array('/full/path/to/views/', '/next/full/path/to/views/'),
- * 'Controller' => array('/full/path/to/controllers/', '/next/full/path/to/controllers/'),
- * 'Model/Datasource' => array('/full/path/to/datasources/', '/next/full/path/to/datasources/'),
- * 'Model/Behavior' => array('/full/path/to/behaviors/', '/next/full/path/to/behaviors/'),
- * 'Controller/Component' => array('/full/path/to/components/', '/next/full/path/to/components/'),
- * 'View/Helper' => array('/full/path/to/helpers/', '/next/full/path/to/helpers/'),
- * 'Vendor' => array('/full/path/to/vendors/', '/next/full/path/to/vendors/'),
- * 'Console/Command' => array('/full/path/to/shells/', '/next/full/path/to/shells/'),
- * 'Locale' => array('/full/path/to/locale/', '/next/full/path/to/locale/')
+ * 'Model' => array('/path/to/models', '/next/path/to/models'),
+ * 'Model/Behavior' => array('/path/to/behaviors', '/next/path/to/behaviors'),
+ * 'Model/Datasource' => array('/path/to/datasources', '/next/path/to/datasources'),
+ * 'Model/Datasource/Database' => array('/path/to/databases', '/next/path/to/database'),
+ * 'Model/Datasource/Session' => array('/path/to/sessions', '/next/path/to/sessions'),
+ * 'Controller' => array('/path/to/controllers', '/next/path/to/controllers'),
+ * 'Controller/Component' => array('/path/to/components', '/next/path/to/components'),
+ * 'Controller/Component/Auth' => array('/path/to/auths', '/next/path/to/auths'),
+ * 'Controller/Component/Acl' => array('/path/to/acls', '/next/path/to/acls'),
+ * 'View' => array('/path/to/views', '/next/path/to/views'),
+ * 'View/Helper' => array('/path/to/helpers', '/next/path/to/helpers'),
+ * 'Console' => array('/path/to/consoles', '/next/path/to/consoles'),
+ * 'Console/Command' => array('/path/to/commands', '/next/path/to/commands'),
+ * 'Console/Command/Task' => array('/path/to/tasks', '/next/path/to/tasks'),
+ * 'Lib' => array('/path/to/libs', '/next/path/to/libs'),
+ * 'Locale' => array('/path/to/locales', '/next/path/to/locales'),
+ * 'Vendor' => array('/path/to/vendors', '/next/path/to/vendors'),
+ * 'Plugin' => array('/path/to/plugins', '/next/path/to/plugins'),
* ));
*
*/
@@ -83,4 +90,4 @@
Configure::write('Dispatcher.filters', array(
'AssetDispatcher',
'CacheDispatcher'
-));
+));
@@ -24,8 +24,8 @@
</head>
<body>
- <?php echo $content_for_layout;?>
+ <?php echo $this->fetch('content');?>
<p>This email was sent using the <a href="http://cakephp.org">CakePHP Framework</a></p>
</body>
-</html>
+</html>
@@ -17,6 +17,6 @@
*/
?>
-<?php echo $content_for_layout;?>
+<?php echo $this->fetch('content');?>
This email was sent using the CakePHP Framework, http://cakephp.org.
@@ -16,4 +16,4 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
?>
-<?php echo $content_for_layout; ?>
+<?php echo $this->fetch('content'); ?>
@@ -1,2 +1,2 @@
<?php echo $scripts_for_layout; ?>
-<script type="text/javascript"><?php echo $content_for_layout; ?></script>
+<script type="text/javascript"><?php echo $this->fetch('content'); ?></script>
@@ -8,7 +8,7 @@ if (!isset($channel['title'])) {
echo $this->Rss->document(
$this->Rss->channel(
- array(), $channel, $content_for_layout
+ array(), $channel, $this->fetch('content')
)
);
-?>
+?>
@@ -1 +1 @@
-<?php echo $content_for_layout; ?>
+<?php echo $this->fetch('content'); ?>
@@ -420,31 +420,6 @@ protected function _findFiles($attachment) {
return null;
}
-/**
- * Encode the specified string using the current charset
- *
- * @param string $subject String to encode
- * @return string Encoded string
- */
- protected function _encode($subject) {
- $subject = $this->_strip($subject);
-
- $nl = "\r\n";
- if ($this->delivery == 'mail') {
- $nl = '';
- }
- $internalEncoding = function_exists('mb_internal_encoding');
- if ($internalEncoding) {
- $restore = mb_internal_encoding();
- mb_internal_encoding($this->charset);
- }
- $return = mb_encode_mimeheader($subject, $this->charset, 'B', $nl);
- if ($internalEncoding) {
- mb_internal_encoding($restore);
- }
- return $return;
- }
-
/**
* Format addresses to be an array with email as key and alias as value
*
@@ -455,7 +430,7 @@ protected function _formatAddresses($addresses) {
$formatted = array();
foreach ($addresses as $address) {
if (preg_match('/((.*))?\s?<(.+)>/', $address, $matches) && !empty($matches[2])) {
- $formatted[$this->_strip($matches[3])] = $this->_encode($matches[2]);
+ $formatted[$this->_strip($matches[3])] = $matches[2];
} else {
$address = $this->_strip($address);
$formatted[$address] = $address;
@@ -77,17 +77,6 @@ class Mysql extends DboSource {
*/
protected $_useAlias = true;
-/**
- * Index of basic SQL commands
- *
- * @var array
- */
- protected $_commands = array(
- 'begin' => 'START TRANSACTION',
- 'commit' => 'COMMIT',
- 'rollback' => 'ROLLBACK'
- );
-
/**
* List of engine specific additional field parameters used on table creating
*
@@ -262,15 +251,6 @@ public function getEncoding() {
return $this->_execute('SHOW VARIABLES LIKE ?', array('character_set_client'))->fetchObject()->Value;
}
-/**
- * Gets the version string of the database server
- *
- * @return string The database encoding
- */
- public function getVersion() {
- return $this->_connection->getAttribute(PDO::ATTR_SERVER_VERSION);
- }
-
/**
* Query charset by collation
*
@@ -696,4 +676,13 @@ public function getSchemaName() {
return $this->config['database'];
}
+/**
+ * Check if the server support nested transactions
+ *
+ * @return boolean
+ */
+ public function supportNestedTransaction() {
+ return $this->nestedTransaction && version_compare($this->getVersion(), '4.1', '>=');
+ }
+
}
@@ -33,17 +33,6 @@ class Postgres extends DboSource {
*/
public $description = "PostgreSQL DBO Driver";
-/**
- * Index of basic SQL commands
- *
- * @var array
- */
- protected $_commands = array(
- 'begin' => 'BEGIN',
- 'commit' => 'COMMIT',
- 'rollback' => 'ROLLBACK'
- );
-
/**
* Base driver configuration settings. Merged with user settings.
*
@@ -906,4 +895,13 @@ public function getSchemaName() {
return $this->config['schema'];
}
+/**
+ * Check if the server support nested transactions
+ *
+ * @return boolean
+ */
+ public function supportNestedTransaction() {
+ return $this->nestedTransaction && version_compare($this->getVersion(), '8.0', '>=');
+ }
+
}
@@ -559,4 +559,13 @@ public function getSchemaName() {
return "main"; // Sqlite Datasource does not support multidb
}
+/**
+ * Check if the server support nested transactions
+ *
+ * @return boolean
+ */
+ public function supportNestedTransaction() {
+ return $this->nestedTransaction && version_compare($this->getVersion(), '3.6.8', '>=');
+ }
+
}
Oops, something went wrong.

0 comments on commit e7a7a17

Please sign in to comment.