added static function registerHooks() for better unit tests handling
This commit is contained in:
parent
b2aa97f166
commit
842d0608f1
|
@ -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");
|
||||
// register hooks
|
||||
\OCA\Files_Trashbin\Trashbin::registerHooks();
|
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue