diff options
Diffstat (limited to 'lib/filesystemview.php')
-rw-r--r-- | lib/filesystemview.php | 44 |
1 files changed, 24 insertions, 20 deletions
diff --git a/lib/filesystemview.php b/lib/filesystemview.php index e944ae5045d..1fc8e83d68f 100644 --- a/lib/filesystemview.php +++ b/lib/filesystemview.php @@ -36,8 +36,12 @@ * * Filesystem functions are not called directly; they are passed to the correct * OC_Filestorage object + * + * @note default root (if $root is empty or '/') is /data/[user]/ + * @note If you don't include a leading slash, you may encounter problems. + * e.g. use $v = new \OC_FilesystemView( '/' . $params['uid'] ); not + * $v = new \OC_FilesystemView( $params['uid'] ); */ - class OC_FilesystemView { private $fakeRoot=''; private $internal_path_cache=array(); @@ -430,10 +434,10 @@ class OC_FilesystemView { $target = $this->fopen($path2.$postFix2, 'w'); $result = OC_Helper::streamCopy($source, $target); } - if( $this->fakeRoot==OC_Filesystem::getRoot() ) { - // If the file to be copied originates within + 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, @@ -454,33 +458,33 @@ class OC_FilesystemView { OC_Filesystem::signal_post_write, array( OC_Filesystem::signal_param_path => $path2) ); - - } else { - // If this is not a normal file copy operation - // and the file originates somewhere else - // (e.g. a version rollback operation), do not + + } 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 + + // 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; - + } } } |