summaryrefslogtreecommitdiffstats
path: root/lib/connector/sabre
diff options
context:
space:
mode:
Diffstat (limited to 'lib/connector/sabre')
-rw-r--r--lib/connector/sabre/directory.php3
-rw-r--r--lib/connector/sabre/file.php7
-rw-r--r--lib/connector/sabre/locks.php33
-rw-r--r--lib/connector/sabre/node.php16
-rw-r--r--lib/connector/sabre/request.php2
5 files changed, 45 insertions, 16 deletions
diff --git a/lib/connector/sabre/directory.php b/lib/connector/sabre/directory.php
index e29059d0395..a9aa891d409 100644
--- a/lib/connector/sabre/directory.php
+++ b/lib/connector/sabre/directory.php
@@ -160,7 +160,8 @@ class OC_Connector_Sabre_Directory extends OC_Connector_Sabre_Node implements Sa
$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.')' );
+ $query = OC_DB::prepare( 'SELECT * FROM `*PREFIX*properties`'
+ .' WHERE `userid` = ?' . ' AND `propertypath` IN ('.$placeholders.')' );
array_unshift($pack, OC_User::getUser()); // prepend userid
$result = $query->execute( $pack );
while($row = $result->fetchRow()) {
diff --git a/lib/connector/sabre/file.php b/lib/connector/sabre/file.php
index 61165d9956d..c4c27e92251 100644
--- a/lib/connector/sabre/file.php
+++ b/lib/connector/sabre/file.php
@@ -84,7 +84,7 @@ class OC_Connector_Sabre_File extends OC_Connector_Sabre_Node implements Sabre_D
*/
public function get() {
- return \OC\Files\Filesystem::fopen($this->path,'rb');
+ return \OC\Files\Filesystem::fopen($this->path, 'rb');
}
@@ -113,8 +113,9 @@ class OC_Connector_Sabre_File extends OC_Connector_Sabre_Node implements Sabre_D
/**
* Returns the ETag for a file
*
- * An ETag is a unique identifier representing the current version of the file. If the file changes, the ETag MUST change.
- * The ETag is an arbritrary string, but MUST be surrounded by double-quotes.
+ * An ETag is a unique identifier representing the current version of the
+ * file. If the file changes, the ETag MUST change. The ETag is an
+ * arbritrary string, but MUST be surrounded by double-quotes.
*
* Return null if the ETag can not effectively be determined
*
diff --git a/lib/connector/sabre/locks.php b/lib/connector/sabre/locks.php
index a72d003bc72..e58e584fb41 100644
--- a/lib/connector/sabre/locks.php
+++ b/lib/connector/sabre/locks.php
@@ -44,7 +44,8 @@ class OC_Connector_Sabre_Locks extends Sabre_DAV_Locks_Backend_Abstract {
// NOTE: SQLite requires time() to be inserted directly. That's ugly
// but otherwise reading locks from SQLite Databases will return
// nothing
- $query = 'SELECT * FROM `*PREFIX*locks` WHERE `userid` = ? AND (`created` + `timeout`) > '.time().' AND (( `uri` = ?)';
+ $query = 'SELECT * FROM `*PREFIX*locks`'
+ .' WHERE `userid` = ? AND (`created` + `timeout`) > '.time().' AND (( `uri` = ?)';
$params = array(OC_User::getUser(), $uri);
// We need to check locks for every part in the uri.
@@ -116,11 +117,33 @@ class OC_Connector_Sabre_Locks extends Sabre_DAV_Locks_Backend_Abstract {
}
if ($exists) {
- $query = OC_DB::prepare( 'UPDATE `*PREFIX*locks` SET `owner` = ?, `timeout` = ?, `scope` = ?, `depth` = ?, `uri` = ?, `created` = ? WHERE `userid` = ? AND `token` = ?' );
- $result = $query->execute( array($lockInfo->owner,$lockInfo->timeout,$lockInfo->scope,$lockInfo->depth,$uri,$lockInfo->created,OC_User::getUser(),$lockInfo->token));
+ $query = OC_DB::prepare( 'UPDATE `*PREFIX*locks`'
+ .' SET `owner` = ?, `timeout` = ?, `scope` = ?, `depth` = ?, `uri` = ?, `created` = ?'
+ .' WHERE `userid` = ? AND `token` = ?' );
+ $result = $query->execute( array(
+ $lockInfo->owner,
+ $lockInfo->timeout,
+ $lockInfo->scope,
+ $lockInfo->depth,
+ $uri,
+ $lockInfo->created,
+ OC_User::getUser(),
+ $lockInfo->token)
+ );
} else {
- $query = OC_DB::prepare( 'INSERT INTO `*PREFIX*locks` (`userid`,`owner`,`timeout`,`scope`,`depth`,`uri`,`created`,`token`) VALUES (?,?,?,?,?,?,?,?)' );
- $result = $query->execute( array(OC_User::getUser(),$lockInfo->owner,$lockInfo->timeout,$lockInfo->scope,$lockInfo->depth,$uri,$lockInfo->created,$lockInfo->token));
+ $query = OC_DB::prepare( 'INSERT INTO `*PREFIX*locks`'
+ .' (`userid`,`owner`,`timeout`,`scope`,`depth`,`uri`,`created`,`token`)'
+ .' VALUES (?,?,?,?,?,?,?,?)' );
+ $result = $query->execute( array(
+ OC_User::getUser(),
+ $lockInfo->owner,
+ $lockInfo->timeout,
+ $lockInfo->scope,
+ $lockInfo->depth,
+ $uri,
+ $lockInfo->created,
+ $lockInfo->token)
+ );
}
return true;
diff --git a/lib/connector/sabre/node.php b/lib/connector/sabre/node.php
index 52995630211..360c3066d05 100644
--- a/lib/connector/sabre/node.php
+++ b/lib/connector/sabre/node.php
@@ -84,12 +84,13 @@ abstract class OC_Connector_Sabre_Node implements Sabre_DAV_INode, Sabre_DAV_IPr
$newPath = $parentPath . '/' . $newName;
$oldPath = $this->path;
- \OC\Files\Filesystem::rename($this->path,$newPath);
+ \OC\Files\Filesystem::rename($this->path, $newPath);
$this->path = $newPath;
- $query = OC_DB::prepare( 'UPDATE `*PREFIX*properties` SET `propertypath` = ? WHERE `userid` = ? AND `propertypath` = ?' );
- $query->execute( array( $newPath,OC_User::getUser(), $oldPath ));
+ $query = OC_DB::prepare( 'UPDATE `*PREFIX*properties` SET `propertypath` = ?'
+ .' WHERE `userid` = ? AND `propertypath` = ?' );
+ $query->execute( array( $newPath, OC_User::getUser(), $oldPath ));
}
@@ -149,7 +150,8 @@ abstract class OC_Connector_Sabre_Node implements Sabre_DAV_INode, Sabre_DAV_IPr
// If it was null, we need to delete the property
if (is_null($propertyValue)) {
if(array_key_exists( $propertyName, $existing )) {
- $query = OC_DB::prepare( 'DELETE FROM `*PREFIX*properties` WHERE `userid` = ? AND `propertypath` = ? AND `propertyname` = ?' );
+ $query = OC_DB::prepare( 'DELETE FROM `*PREFIX*properties`'
+ .' WHERE `userid` = ? AND `propertypath` = ? AND `propertyname` = ?' );
$query->execute( array( OC_User::getUser(), $this->path, $propertyName ));
}
}
@@ -160,10 +162,12 @@ abstract class OC_Connector_Sabre_Node implements Sabre_DAV_INode, Sabre_DAV_IPr
$this->touch($propertyValue);
} else {
if(!array_key_exists( $propertyName, $existing )) {
- $query = OC_DB::prepare( 'INSERT INTO `*PREFIX*properties` (`userid`,`propertypath`,`propertyname`,`propertyvalue`) VALUES(?,?,?,?)' );
+ $query = OC_DB::prepare( 'INSERT INTO `*PREFIX*properties`'
+ .' (`userid`,`propertypath`,`propertyname`,`propertyvalue`) VALUES(?,?,?,?)' );
$query->execute( array( OC_User::getUser(), $this->path, $propertyName,$propertyValue ));
} else {
- $query = OC_DB::prepare( 'UPDATE `*PREFIX*properties` SET `propertyvalue` = ? WHERE `userid` = ? AND `propertypath` = ? AND `propertyname` = ?' );
+ $query = OC_DB::prepare( 'UPDATE `*PREFIX*properties` SET `propertyvalue` = ?'
+ .' WHERE `userid` = ? AND `propertypath` = ? AND `propertyname` = ?' );
$query->execute( array( $propertyValue,OC_User::getUser(), $this->path, $propertyName ));
}
}
diff --git a/lib/connector/sabre/request.php b/lib/connector/sabre/request.php
index 97a27996bf3..d70c25c4e70 100644
--- a/lib/connector/sabre/request.php
+++ b/lib/connector/sabre/request.php
@@ -40,7 +40,7 @@ class OC_Connector_Sabre_Request extends Sabre_HTTP_Request {
* @return string
*/
public function getRawServerValue($field) {
- if($field == 'REQUEST_URI'){
+ if($field == 'REQUEST_URI') {
return $this->getUri();
}
else{