From 08bb5499fab72a964bf3dbd444da1bce6e4b37b8 Mon Sep 17 00:00:00 2001 From: Ebrahim Imami Date: Sun, 3 Sep 2017 11:45:37 +0430 Subject: [PATCH] Fixed error with String class in PHP>5.6 and CakePHP 2.9 --- Model/Datasource/MongodbSource.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Model/Datasource/MongodbSource.php b/Model/Datasource/MongodbSource.php index 3ce32e1..bce113a 100755 --- a/Model/Datasource/MongodbSource.php +++ b/Model/Datasource/MongodbSource.php @@ -607,7 +607,7 @@ public function dropSchema(CakeSchema $schema, $tableName = null) { $return = "toDrop = :tables;\nfor( i = 0; i < toDrop.length; i++ ) {\n\tdb[toDrop[i]].drop();\n}"; $tables = '["' . implode($toDrop, '", "') . '"]'; - return String::insert($return, compact('tables')); + return CakeText::insert($return, compact('tables')); } /** @@ -1316,7 +1316,7 @@ public function mapReduce($query, $timeout = null) { * @return mixed Prepared value or array of values. * @access public */ - public function value($data, $column = null) { + public function value($data, $column = null, $null = true) { if (is_array($data) && !empty($data)) { return array_map( array(&$this, 'value'), @@ -1473,7 +1473,7 @@ public function setTimeout($ms){ public function logQuery($query, $args = array()) { if ($args) { $this->_stringify($args); - $query = String::insert($query, $args); + $query = CakeText::insert($query, $args); } $this->took = round((microtime(true) - $this->_startTime) * 1000, 0); $this->affected = null;