Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #43 from josegonzalez/master

Fixed call-time pass-by-reference fatal error in php 5.4
  • Loading branch information...
commit 509a44f9723953dc4765d1f1de95626d73e48f3e 2 parents 814cf54 + a36c4dd
@lorenzo lorenzo authored
View
10 Model/Behavior/BtreeBehavior.php
@@ -653,7 +653,7 @@ function recover(&$Model, $mode = 'parent', $missingParentAction = null) {
}
}
} else {
- $db =& ConnectionManager::getDataSource($Model->useDbConfig);
+ $db = ConnectionManager::getDataSource($Model->useDbConfig);
foreach ($Model->find('all', array('conditions' => $scope, 'fields' => array($Model->primaryKey, $parent), 'order' => $left)) as $array) {
$path = $this->getPath($Model, $array[$Model->alias][$Model->primaryKey]);
if ($path == null || count($path) < 2) {
@@ -752,7 +752,7 @@ function removeFromTree(&$Model, $id = null, $delete = false) {
$parentNode[$right] = $node[$right] + 1;
}
- $db =& ConnectionManager::getDataSource($Model->useDbConfig);
+ $db = ConnectionManager::getDataSource($Model->useDbConfig);
$Model->updateAll(array($parent => $db->value($node[$parent], $parent)), array($parent => $node[$Model->primaryKey]));
$Model->id = $id;
@@ -1005,7 +1005,7 @@ function _setParent(&$Model, $parentId = null, $created = false) {
function __getPartition($Model, $scope, $recursive = -1, $created = false) {
extract($this->settings[$Model->alias]);
- $db =& ConnectionManager::getDataSource($Model->useDbConfig);
+ $db = ConnectionManager::getDataSource($Model->useDbConfig);
if ($created) {
if (is_string($scope)) {
$scope .= " AND {$Model->alias}.{$Model->primaryKey} <> ";
@@ -1048,7 +1048,7 @@ function __getPartition($Model, $scope, $recursive = -1, $created = false) {
* @return int
*/
function __getMax($Model, $scope, $right, $recursive = -1, $created = false) {
- $db =& ConnectionManager::getDataSource($Model->useDbConfig);
+ $db = ConnectionManager::getDataSource($Model->useDbConfig);
if ($created) {
if (is_string($scope)) {
$scope .= " AND {$Model->alias}.{$Model->primaryKey} <> ";
@@ -1078,7 +1078,7 @@ function __getMax($Model, $scope, $right, $recursive = -1, $created = false) {
* @return int
*/
function __getMin($Model, $scope, $left, $recursive = -1) {
- $db =& ConnectionManager::getDataSource($Model->useDbConfig);
+ $db = ConnectionManager::getDataSource($Model->useDbConfig);
list($edge) = array_values($Model->find('first', array(
'conditions' => $scope,
'fields' => $db->calculate($Model, 'min', array($left)),
View
10 Model/Behavior/PublishableBehavior.php
@@ -157,7 +157,7 @@ function beforeFind(&$Model, $queryData, $recursive = null) {
}
if ($this->__settings[$Model->alias]['find'] && $Model->hasField($this->__settings[$Model->alias]['field'])) {
- $Db =& ConnectionManager::getDataSource($Model->useDbConfig);
+ $Db = ConnectionManager::getDataSource($Model->useDbConfig);
$include = false;
if (!empty($queryData['conditions']) && is_string($queryData['conditions'])) {
@@ -173,16 +173,16 @@ function beforeFind(&$Model, $queryData, $recursive = null) {
foreach($fields as $field) {
if (preg_match('/^' . preg_quote($field) . '[\s=!]+/i', $queryData['conditions']) ||
preg_match('/\\x20+' . preg_quote($field) . '[\s=!]+/i', $queryData['conditions'])) {
-
+
$include = false;
break;
}
}
}
else if (empty($queryData['conditions']) ||
- (!in_array($this->__settings[$Model->alias]['field'], array_keys($queryData['conditions'])) &&
+ (!in_array($this->__settings[$Model->alias]['field'], array_keys($queryData['conditions'])) &&
!in_array($Model->alias . '.' . $this->__settings[$Model->alias]['field'], array_keys($queryData['conditions'])))) {
-
+
$include = true;
}
@@ -204,7 +204,7 @@ function beforeFind(&$Model, $queryData, $recursive = null) {
}
}
}
-
+
if (is_null($recursive) && !empty($queryData['recursive'])) {
$recursive = $queryData['recursive'];
} elseif (is_null($recursive)) {
Please sign in to comment.
Something went wrong with that request. Please try again.