diff options
author | Robin Appelman <icewind@owncloud.com> | 2012-11-07 17:18:56 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2012-11-07 17:18:56 +0100 |
commit | 961ff01a93dd69cb12196a1b8507cce925e74fbc (patch) | |
tree | 4956c9a42d6286b0851ca73641439e5c002f6a9a /lib/connector/sabre | |
parent | 4b940955ddb3266f625eae83da412a655efef319 (diff) | |
parent | 5cad2d7ccc3d2b4ccd9e1b090e28787f1c28b6ca (diff) | |
download | nextcloud-server-961ff01a93dd69cb12196a1b8507cce925e74fbc.tar.gz nextcloud-server-961ff01a93dd69cb12196a1b8507cce925e74fbc.zip |
merge master into filesystem
Diffstat (limited to 'lib/connector/sabre')
-rw-r--r-- | lib/connector/sabre/node.php | 16 | ||||
-rw-r--r-- | lib/connector/sabre/quotaplugin.php | 16 |
2 files changed, 22 insertions, 10 deletions
diff --git a/lib/connector/sabre/node.php b/lib/connector/sabre/node.php index 2095c956e5f..ebc9e539625 100644 --- a/lib/connector/sabre/node.php +++ b/lib/connector/sabre/node.php @@ -26,6 +26,13 @@ abstract class OC_Connector_Sabre_Node implements Sabre_DAV_INode, Sabre_DAV_IPr const LASTMODIFIED_PROPERTYNAME = '{DAV:}lastmodified'; /** + * Allow configuring the method used to generate Etags + * + * @var array(class_name, function_name) + */ + public static $ETagFunction = null; + + /** * The path to the current node * * @var string @@ -178,7 +185,7 @@ abstract class OC_Connector_Sabre_Node implements Sabre_DAV_INode, Sabre_DAV_IPr * If the array is empty, all properties should be returned * * @param array $properties - * @return void + * @return array */ public function getProperties($properties) { if (is_null($this->property_cache)) { @@ -209,7 +216,12 @@ abstract class OC_Connector_Sabre_Node implements Sabre_DAV_INode, Sabre_DAV_IPr * @return string|null Returns null if the ETag can not effectively be determined */ static protected function createETag($path) { - return uniqid('', true); + if(self::$ETagFunction) { + $hash = call_user_func(self::$ETagFunction, $path); + return $hash; + }else{ + return uniqid('', true); + } } /** diff --git a/lib/connector/sabre/quotaplugin.php b/lib/connector/sabre/quotaplugin.php index 5b8ef941710..a56a65ad863 100644 --- a/lib/connector/sabre/quotaplugin.php +++ b/lib/connector/sabre/quotaplugin.php @@ -2,7 +2,7 @@ /** * This plugin check user quota and deny creating files when they exceeds the quota. - * + * * @copyright Copyright (C) 2012 entreCables S.L. All rights reserved. * @author Sergio Cambra * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License @@ -10,9 +10,9 @@ class OC_Connector_Sabre_QuotaPlugin extends Sabre_DAV_ServerPlugin { /** - * Reference to main server object - * - * @var Sabre_DAV_Server + * Reference to main server object + * + * @var Sabre_DAV_Server */ private $server; @@ -23,8 +23,8 @@ class OC_Connector_Sabre_QuotaPlugin extends Sabre_DAV_ServerPlugin { * addPlugin is called. * * This method should set up the requires event subscriptions. - * - * @param Sabre_DAV_Server $server + * + * @param Sabre_DAV_Server $server * @return void */ public function initialize(Sabre_DAV_Server $server) { @@ -37,10 +37,10 @@ class OC_Connector_Sabre_QuotaPlugin extends Sabre_DAV_ServerPlugin { /** * This method is called before any HTTP method and forces users to be authenticated - * + * * @param string $method * @throws Sabre_DAV_Exception - * @return bool + * @return bool */ public function checkQuota($uri, $data = null) { $expected = $this->server->httpRequest->getHeader('X-Expected-Entity-Length'); |