[Pkg-owncloud-commits] [owncloud] 98/394: backport of #271 to stable45
David Prévot
taffit at alioth.debian.org
Fri Nov 8 23:11:36 UTC 2013
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to annotated tag v4.5.10
in repository owncloud.
commit 8724fe4b11b75ba2cd5c176a3bc14451105d50c7
Author: Thomas Mueller <thomas.mueller at tmit.eu>
Date: Mon Nov 5 22:42:03 2012 +0100
backport of #271 to stable45
---
lib/connector/sabre/directory.php | 25 ++++++++++++++-----------
1 file changed, 14 insertions(+), 11 deletions(-)
diff --git a/lib/connector/sabre/directory.php b/lib/connector/sabre/directory.php
index 56c17da..90fd92d 100644
--- a/lib/connector/sabre/directory.php
+++ b/lib/connector/sabre/directory.php
@@ -128,22 +128,25 @@ class OC_Connector_Sabre_Directory extends OC_Connector_Sabre_Node implements Sa
}
$properties = array_fill_keys($paths, array());
if(count($paths)>0) {
- $placeholders = join(',', array_fill(0, count($paths), '?'));
- $query = OC_DB::prepare( 'SELECT * FROM `*PREFIX*properties` WHERE `userid` = ?' . ' AND `propertypath` IN ('.$placeholders.')' );
- array_unshift($paths, $user); // prepend userid
- $result = $query->execute( $paths );
- while($row = $result->fetchRow()) {
- $propertypath = $row['propertypath'];
- $propertyname = $row['propertyname'];
- $propertyvalue = $row['propertyvalue'];
- $properties[$propertypath][$propertyname] = $propertyvalue;
+ $chunks = array_chunk($paths, 200, false);
+ foreach ($chunks as $pack) {
+ $placeholders = join(',', array_fill(0, count($pack), '?'));
+ $query = OC_DB::prepare( 'SELECT * FROM `*PREFIX*properties` WHERE `userid` = ?' . ' AND `propertypath` IN ('.$placeholders.')' );
+ array_unshift($pack, $user); // prepend userid
+ $result = $query->execute( $pack );
+ while($row = $result->fetchRow()) {
+ $propertypath = $row['propertypath'];
+ $propertyname = $row['propertyname'];
+ $propertyvalue = $row['propertyvalue'];
+ $properties[$propertypath][$propertyname] = $propertyvalue;
+ }
}
}
$nodes = array();
foreach($folder_content as $info) {
$node = $this->getChild($info['name'], $info);
- $node->setPropertyCache($properties[$path.'/'.$info['name']]);
+ $node->setPropertyCache($properties[$this->path.'/'.$info['name']]);
$nodes[] = $node;
}
return $nodes;
@@ -204,7 +207,7 @@ class OC_Connector_Sabre_Directory extends OC_Connector_Sabre_Node implements Sa
public function getProperties($properties) {
$props = parent::getProperties($properties);
if (in_array(self::GETETAG_PROPERTYNAME, $properties) && !isset($props[self::GETETAG_PROPERTYNAME])) {
- $props[self::GETETAG_PROPERTYNAME]
+ $props[self::GETETAG_PROPERTYNAME]
= OC_Connector_Sabre_Node::getETagPropertyForPath($this->path);
}
return $props;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list