Remove old etag code

This commit is contained in:
Michael Gapczynski 2012-12-30 19:23:31 -05:00
parent a5cb7363a5
commit 83064aca51
4 changed files with 0 additions and 54 deletions

View file

@ -218,28 +218,4 @@ abstract class OC_Connector_Sabre_Node implements Sabre_DAV_INode, Sabre_DAV_IPr
return null;
}
/**
* @brief Remove the ETag from the cache.
* @param string $path Path of the file
*/
static public function removeETagPropertyForPath($path) {
// remove tags from this and parent paths
$paths = array();
while ($path != '/' && $path != '.' && $path != '' && $path != '\\') {
$paths[] = $path;
$path = dirname($path);
}
if (empty($paths)) {
return;
}
$paths[] = $path;
$path_placeholders = join(',', array_fill(0, count($paths), '?'));
$query = OC_DB::prepare( 'DELETE FROM `*PREFIX*properties`'
.' WHERE `userid` = ?'
.' AND `propertyname` = ?'
.' AND `propertypath` IN ('.$path_placeholders.')'
);
$vals = array( OC_User::getUser(), self::GETETAG_PROPERTYNAME );
$query->execute(array_merge( $vals, $paths ));
}
}

View file

@ -582,23 +582,6 @@ class Filesystem {
return self::$defaultInstance->hasUpdated($path, $time);
}
static public function removeETagHook($params, $root = false) {
if (isset($params['path'])) {
$path = $params['path'];
} else {
$path = $params['oldpath'];
}
if ($root) { // reduce path to the required part of it (no 'username/files')
$fakeRootView = new View($root);
$count = 1;
$path = str_replace(\OC_App::getStorage("files")->getAbsolutePath(''), "", $fakeRootView->getAbsolutePath($path), $count);
}
$path = self::normalizePath($path);
\OC_Connector_Sabre_Node::removeETagPropertyForPath($path);
}
/**
* normalize a path
*
@ -682,10 +665,6 @@ class Filesystem {
}
}
\OC_Hook::connect('OC_Filesystem', 'post_write', 'OC_Filesystem', 'removeETagHook');
\OC_Hook::connect('OC_Filesystem', 'post_delete', 'OC_Filesystem', 'removeETagHook');
\OC_Hook::connect('OC_Filesystem', 'post_rename', 'OC_Filesystem', 'removeETagHook');
\OC_Hook::connect('OC_Filesystem', 'post_write', '\OC\Files\Cache\Updater', 'writeHook');
\OC_Hook::connect('OC_Filesystem', 'post_delete', '\OC\Files\Cache\Updater', 'deleteHook');
\OC_Hook::connect('OC_Filesystem', 'post_rename', '\OC\Files\Cache\Updater', 'renameHook');

View file

@ -462,8 +462,6 @@ class View {
Filesystem::signal_post_write,
array(Filesystem::signal_param_path => $path2)
);
} else { // no real copy, file comes from somewhere else, e.g. version rollback -> just update the file cache and the webdav properties without all the other post_write actions
Filesystem::removeETagHook(array("path" => $path2), $this->fakeRoot);
}
return $result;
} else {

View file

@ -398,13 +398,6 @@ class OC_Filesystem {
return \OC\Files\Filesystem::hasUpdated($path, $time);
}
/**
* @deprecated OC_Filesystem is replaced by \OC\Files\Filesystem
*/
static public function removeETagHook($params, $root = false) {
\OC\Files\Filesystem::removeETagHook($params, $root);
}
/**
* normalize a path
*