Rename install hook functions to register hook

This commit is contained in:
Bart Visscher 2012-11-15 18:13:54 +01:00
parent 530f3f8be9
commit 8bed38c78d
3 changed files with 11 additions and 11 deletions

View File

@ -433,9 +433,9 @@ class OC{
//setup extra user backends
OC_User::setupBackends();
self::installCacheHooks();
self::installFilesystemHooks();
self::installShareHooks();
self::registerCacheHooks();
self::registerFilesystemHooks();
self::registerShareHooks();
//make sure temporary files are cleaned up
register_shutdown_function(array('OC_Helper', 'cleanTmp'));
@ -471,27 +471,27 @@ class OC{
}
/**
* install hooks for the cache
* register hooks for the cache
*/
public static function installCacheHooks() {
public static function registerCacheHooks() {
// register cache cleanup jobs
OC_BackgroundJob_RegularTask::register('OC_Cache_FileGlobal', 'gc');
OC_Hook::connect('OC_User', 'post_login', 'OC_Cache_File', 'loginListener');
}
/**
* install hooks for the filesystem
* register hooks for the filesystem
*/
public static function installFilesystemHooks() {
public static function registerFilesystemHooks() {
// Check for blacklisted files
OC_Hook::connect('OC_Filesystem', 'write', 'OC_Filesystem', 'isBlacklisted');
OC_Hook::connect('OC_Filesystem', 'rename', 'OC_Filesystem', 'isBlacklisted');
}
/**
* install hooks for sharing
* register hooks for sharing
*/
public static function installShareHooks() {
public static function registerShareHooks() {
OC_Hook::connect('OC_User', 'post_deleteUser', 'OCP\Share', 'post_deleteUser');
OC_Hook::connect('OC_User', 'post_addToGroup', 'OCP\Share', 'post_addToGroup');
OC_Hook::connect('OC_User', 'post_removeFromGroup', 'OCP\Share', 'post_removeFromGroup');

View File

@ -74,7 +74,7 @@ class Test_Filesystem extends UnitTestCase {
public function testBlacklist() {
OC_Hook::clear('OC_Filesystem');
OC::installFilesystemHooks();
OC::registerFilesystemHooks();
$run = true;
OC_Hook::emit(

View File

@ -55,7 +55,7 @@ class Test_Share extends UnitTestCase {
OC_Group::addToGroup($this->user4, $this->group2);
OCP\Share::registerBackend('test', 'Test_Share_Backend');
OC_Hook::clear('OCP\\Share');
OC::installShareHooks();
OC::registerShareHooks();
}
public function tearDown() {