summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorin Peter <github@florin-peter.de>2013-05-22 23:50:45 +0200
committerFlorin Peter <github@florin-peter.de>2013-05-22 23:50:45 +0200
commit842d0608f12462d38bd7c03ba9701f83f8af9ad7 (patch)
treed4014e38d91a1a0c362f0350e7bd458db4d557ea
parentb2aa97f1669333b6a762891f844ff4d0e79958a9 (diff)
downloadnextcloud-server-842d0608f12462d38bd7c03ba9701f83f8af9ad7.tar.gz
nextcloud-server-842d0608f12462d38bd7c03ba9701f83f8af9ad7.zip
added static function registerHooks() for better unit tests handling
-rw-r--r--apps/files_trashbin/appinfo/app.php6
-rw-r--r--apps/files_trashbin/lib/trash.php11
2 files changed, 12 insertions, 5 deletions
diff --git a/apps/files_trashbin/appinfo/app.php b/apps/files_trashbin/appinfo/app.php
index e83d3b8fbbd..3b1e0ac30cc 100644
--- a/apps/files_trashbin/appinfo/app.php
+++ b/apps/files_trashbin/appinfo/app.php
@@ -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
diff --git a/apps/files_trashbin/lib/trash.php b/apps/files_trashbin/lib/trash.php
index 70df9e2426a..2d1830a38f1 100644
--- a/apps/files_trashbin/lib/trash.php
+++ b/apps/files_trashbin/lib/trash.php
@@ -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");
+ }
}