diff options
author | Bart Visscher <bartv@thisnet.nl> | 2012-11-30 03:25:06 -0800 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2012-11-30 03:25:06 -0800 |
commit | 4db53f9d8ea3396387b1c7e5bc41c9c15922b938 (patch) | |
tree | bb921a18bd17a0fd62143c3b193880ddc8ea092a /lib/filesystemview.php | |
parent | 16a630024c3fc7a736dbcb150eb32701e4db6553 (diff) | |
parent | 6975c5537bd3562bb6c6f33810fd05d609882c28 (diff) | |
download | nextcloud-server-4db53f9d8ea3396387b1c7e5bc41c9c15922b938.tar.gz nextcloud-server-4db53f9d8ea3396387b1c7e5bc41c9c15922b938.zip |
Merge pull request #619 from samtuke/versions_cache
OC_FSV->copy now only caches files which are copied from data/user/files
Diffstat (limited to 'lib/filesystemview.php')
-rw-r--r-- | lib/filesystemview.php | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/lib/filesystemview.php b/lib/filesystemview.php index 1185c25c240..e944ae5045d 100644 --- a/lib/filesystemview.php +++ b/lib/filesystemview.php @@ -430,7 +430,10 @@ class OC_FilesystemView { $target = $this->fopen($path2.$postFix2, 'w'); $result = OC_Helper::streamCopy($source, $target); } - if( $this->fakeRoot==OC_Filesystem::getRoot() ) { + if( $this->fakeRoot==OC_Filesystem::getRoot() ) { + // If the file to be copied originates within + // the user's data directory + OC_Hook::emit( OC_Filesystem::CLASSNAME, OC_Filesystem::signal_post_copy, @@ -451,11 +454,33 @@ class OC_FilesystemView { OC_Filesystem::signal_post_write, array( OC_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 - OC_FileCache_Update::update($path2, $this->fakeRoot); + + } else { + // If this is not a normal file copy operation + // and the file originates somewhere else + // (e.g. a version rollback operation), do not + // perform all the other post_write actions + + // Update webdav properties OC_Filesystem::removeETagHook(array("path" => $path2), $this->fakeRoot); + + $splitPath2 = explode( '/', $path2 ); + + // Only cache information about files + // that are being copied from within + // the user files directory. Caching + // other files, like VCS backup files, + // serves no purpose + if ( $splitPath2[1] == 'files' ) { + + OC_FileCache_Update::update($path2, $this->fakeRoot); + + } + } + return $result; + } } } |