const GETETAG_PROPERTYNAME = '{DAV:}getetag';
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
*
* 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)) {
* @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);
+ }
}
/**