diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..217a0e30c --- /dev/null +++ b/.editorconfig @@ -0,0 +1,13 @@ +; This file is for unifying the coding style for different editors and IDEs. +; More information at http://editorconfig.org + +root = true + +[*] +indent_style = tab +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true + +[*.bat] +end_of_line = crlf diff --git a/app/Config/core.php b/app/Config/core.php index ad5c50f03..142ecad14 100644 --- a/app/Config/core.php +++ b/app/Config/core.php @@ -42,7 +42,8 @@ * Options: * * - `handler` - callback - The callback to handle errors. You can set this to any callable type, - * including anonymous functions. + * including anonymous functions. + * Make sure you add App::uses('MyHandler', 'Error'); when using a custom handler class * - `level` - int - The level of errors you are interested in capturing. * - `trace` - boolean - Include stack traces for errors in log files. * @@ -64,6 +65,7 @@ * * - `handler` - callback - The callback to handle exceptions. You can set this to any callback type, * including anonymous functions. + * Make sure you add App::uses('MyHandler', 'Error'); when using a custom handler class * - `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? diff --git a/lib/Cake/Console/Templates/skel/Config/core.php b/lib/Cake/Console/Templates/skel/Config/core.php index c1a2a112d..94913f3f6 100644 --- a/lib/Cake/Console/Templates/skel/Config/core.php +++ b/lib/Cake/Console/Templates/skel/Config/core.php @@ -42,7 +42,8 @@ * Options: * * - `handler` - callback - The callback to handle errors. You can set this to any callable type, - * including anonymous functions. + * including anonymous functions. + * Make sure you add App::uses('MyHandler', 'Error'); when using a custom handler class * - `level` - int - The level of errors you are interested in capturing. * - `trace` - boolean - Include stack traces for errors in log files. * @@ -64,6 +65,7 @@ * * - `handler` - callback - The callback to handle exceptions. You can set this to any callback type, * including anonymous functions. + * Make sure you add App::uses('MyHandler', 'Error'); when using a custom handler class * - `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? diff --git a/lib/Cake/Model/Datasource/Database/Sqlserver.php b/lib/Cake/Model/Datasource/Database/Sqlserver.php index b5addafaa..58e8b1cbe 100644 --- a/lib/Cake/Model/Datasource/Database/Sqlserver.php +++ b/lib/Cake/Model/Datasource/Database/Sqlserver.php @@ -287,9 +287,14 @@ class Sqlserver extends DboSource { $fieldAlias = $this->name($alias . '__' . $fields[$i]); } else { $build = explode('.', $fields[$i]); - $this->_fieldMappings[$build[0] . '__' . $build[1]] = $fields[$i]; - $fieldName = $this->name($build[0] . '.' . $build[1]); - $fieldAlias = $this->name(preg_replace("/^\[(.+)\]$/", "$1", $build[0]) . '__' . $build[1]); + $build[0] = trim($build[0], '[]'); + $build[1] = trim($build[1], '[]'); + $name = $build[0] . '.' . $build[1]; + $alias = $build[0] . '__' . $build[1]; + + $this->_fieldMappings[$alias] = $name; + $fieldName = $this->name($name); + $fieldAlias = $this->name($alias); } if ($model->getColumnType($fields[$i]) == 'datetime') { $fieldName = "CONVERT(VARCHAR(20), {$fieldName}, 20)"; diff --git a/lib/Cake/Model/Model.php b/lib/Cake/Model/Model.php index 907f39a6e..47827af24 100644 --- a/lib/Cake/Model/Model.php +++ b/lib/Cake/Model/Model.php @@ -2660,7 +2660,7 @@ class Model extends Object implements CakeEventListener { * @param string $type Type of find operation (all / first / count / neighbors / list / threaded) * @param array $query Option fields (conditions / fields / joins / limit / offset / order / page / group / callbacks) * @return array Array of records, or Null on failure. - * @link http://book.cakephp.org/2.0/en/models/deleting-data.html#deleteall + * @link http://book.cakephp.org/2.0/en/models/retrieving-your-data.html */ public function find($type = 'first', $query = array()) { $this->findQueryType = $type; diff --git a/lib/Cake/Test/Case/Model/Behavior/TreeBehaviorUuidTest.php b/lib/Cake/Test/Case/Model/Behavior/TreeBehaviorUuidTest.php index bd3590b3c..ce0b32ac6 100644 --- a/lib/Cake/Test/Case/Model/Behavior/TreeBehaviorUuidTest.php +++ b/lib/Cake/Test/Case/Model/Behavior/TreeBehaviorUuidTest.php @@ -248,7 +248,10 @@ class TreeBehaviorUuidTest extends CakeTestCase { $this->Tree->bindModel(array('belongsTo' => array('Dummy' => array('className' => $modelClass, 'foreignKey' => $parentField, 'conditions' => array('Dummy.id' => null)))), false); - $data = $this->Tree->find('first', array('conditions' => array($modelClass . '.name' => '1. Root'))); + $data = $this->Tree->find('first', array( + 'conditions' => array($modelClass . '.name' => '1. Root'), + 'recursive' => -1 + )); $this->Tree->id = $data[$modelClass]['id']; $direct = $this->Tree->children(null, true, array('name', $leftField, $rightField)); diff --git a/lib/Cake/Utility/Debugger.php b/lib/Cake/Utility/Debugger.php index e809ab077..09f967983 100644 --- a/lib/Cake/Utility/Debugger.php +++ b/lib/Cake/Utility/Debugger.php @@ -427,7 +427,7 @@ class Debugger { * @return string */ protected static function _highlight($str) { - if (function_exists('hphp_log')) { + if (function_exists('hphp_log') || function_exists('hphp_gettid')) { return htmlentities($str); } $added = false;