]> source.dussan.org Git - nextcloud-server.git/commitdiff
added static function registerHooks() for better unit tests handling
authorFlorin Peter <github@florin-peter.de>
Wed, 22 May 2013 21:50:45 +0000 (23:50 +0200)
committerFlorin Peter <github@florin-peter.de>
Wed, 22 May 2013 21:50:45 +0000 (23:50 +0200)
apps/files_trashbin/appinfo/app.php
apps/files_trashbin/lib/trash.php

index e83d3b8fbbd766ccadf600b766452bec191e3a16..3b1e0ac30cc3e4dc802cc86e427e3f7c64d4e475 100644 (file)
@@ -3,7 +3,5 @@
 OC::$CLASSPATH['OCA\Files_Trashbin\Hooks'] = 'files_trashbin/lib/hooks.php';
 OC::$CLASSPATH['OCA\Files_Trashbin\Trashbin'] = 'files_trashbin/lib/trash.php';
 
-//Listen to delete file signal
-OCP\Util::connectHook('OC_Filesystem', 'delete', "OCA\Files_Trashbin\Hooks", "remove_hook");
-//Listen to delete user signal
-OCP\Util::connectHook('OC_User', 'pre_deleteUser', "OCA\Files_Trashbin\Hooks", "deleteUser_hook");
\ No newline at end of file
+// register hooks
+\OCA\Files_Trashbin\Trashbin::registerHooks();
\ No newline at end of file
index 70df9e2426abbd220b70713372fda1471e65cc99..2d1830a38f1b4a8e10e575dab4cfc2b5222fdb49 100644 (file)
@@ -833,5 +833,14 @@ class Trashbin {
                }
                $query->execute(array($size, $user));
        }
-       
+
+       /**
+        * register hooks
+        */
+       public static function registerHooks() {
+               //Listen to delete file signal
+               \OCP\Util::connectHook('OC_Filesystem', 'delete', "OCA\Files_Trashbin\Hooks", "remove_hook");
+               //Listen to delete user signal
+               \OCP\Util::connectHook('OC_User', 'pre_deleteUser', "OCA\Files_Trashbin\Hooks", "deleteUser_hook");
+       }
 }