diff options
author | Bart Visscher <bartv@thisnet.nl> | 2013-02-11 17:44:02 +0100 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2013-02-14 08:38:37 +0100 |
commit | ffae6f4b847e96d691053300c355ab81edc6c1c8 (patch) | |
tree | 928a210abf40ab333c0a08fb469be87c71147b24 /lib/connector | |
parent | 2d6d0a4ad438590504c13f04a6b2916a59a99c30 (diff) | |
download | nextcloud-server-ffae6f4b847e96d691053300c355ab81edc6c1c8.tar.gz nextcloud-server-ffae6f4b847e96d691053300c355ab81edc6c1c8.zip |
Style-fix: Breakup long lines
Diffstat (limited to 'lib/connector')
-rw-r--r-- | lib/connector/sabre/directory.php | 3 | ||||
-rw-r--r-- | lib/connector/sabre/file.php | 5 | ||||
-rw-r--r-- | lib/connector/sabre/locks.php | 33 | ||||
-rw-r--r-- | lib/connector/sabre/node.php | 12 |
4 files changed, 41 insertions, 12 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 c7375541e86..c4c27e92251 100644 --- a/lib/connector/sabre/file.php +++ b/lib/connector/sabre/file.php @@ -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 57ce3710db8..360c3066d05 100644 --- a/lib/connector/sabre/node.php +++ b/lib/connector/sabre/node.php @@ -88,7 +88,8 @@ abstract class OC_Connector_Sabre_Node implements Sabre_DAV_INode, Sabre_DAV_IPr $this->path = $newPath; - $query = OC_DB::prepare( 'UPDATE `*PREFIX*properties` SET `propertypath` = ? WHERE `userid` = ? AND `propertypath` = ?' ); + $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 )); } } |