]> source.dussan.org Git - nextcloud-server.git/commitdiff
don't use OC_FilesystemView()
authorBjörn Schießle <schiessle@owncloud.com>
Sun, 10 Feb 2013 13:17:18 +0000 (14:17 +0100)
committerBjörn Schießle <schiessle@owncloud.com>
Sun, 10 Feb 2013 13:17:18 +0000 (14:17 +0100)
apps/files_versions/lib/hooks.php

index dc02c605c44ce51877a807dd7ffa4572c47550a6..6c87eba423d0ba41b49c842b6442175acb41b9c9 100644 (file)
@@ -20,13 +20,10 @@ class Hooks {
        public static function write_hook( $params ) {
 
                if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {
-
-                       $versions = new Storage( new \OC\Files\View('') );
-
                        $path = $params[\OC\Files\Filesystem::signal_param_path];
-
-                       if($path<>'') $versions->store( $path );
-
+                       if($path<>'') {
+                               Storage::store($path);
+                       }
                }
        }
 
@@ -40,12 +37,10 @@ class Hooks {
         */
        public static function remove_hook($params) {
                if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {
-               
-                       $versions = new Storage( new \OC_FilesystemView('') );
-               
                        $path = $params[\OC\Files\Filesystem::signal_param_path];
-               
-                       if($path<>'') $versions->delete( $path );
+                       if($path<>'') {
+                               Storage::delete($path);
+                       }
                
                }
        }
@@ -59,13 +54,11 @@ class Hooks {
         */
        public static function rename_hook($params) {
                if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {
-               
-                       $versions = new Storage( new \OC_FilesystemView('') );
-               
                        $oldpath = $params['oldpath'];
                        $newpath = $params['newpath'];
-               
-                       if($oldpath<>'' && $newpath<>'') $versions->rename( $oldpath, $newpath );
+                       if($oldpath<>'' && $newpath<>'') {
+                               Storage::rename( $oldpath, $newpath );
+                       }
                
                }
        }