當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Util::connectHook方法代碼示例

本文整理匯總了PHP中OCP\Util::connectHook方法的典型用法代碼示例。如果您正苦於以下問題:PHP Util::connectHook方法的具體用法?PHP Util::connectHook怎麽用?PHP Util::connectHook使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在OCP\Util的用法示例。


在下文中一共展示了Util::connectHook方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 public function __construct(IL10N $l, ISession $session, ICredentialsManager $credentialsManager)
 {
     $this->session = $session;
     $this->credentialsManager = $credentialsManager;
     $this->setIdentifier('password::logincredentials')->setScheme(self::SCHEME_PASSWORD)->setText($l->t('Log-in credentials, save in database'))->addParameters([]);
     \OCP\Util::connectHook('OC_User', 'post_login', $this, 'authenticate');
 }
開發者ID:farukuzun,項目名稱:core-1,代碼行數:7,代碼來源:logincredentials.php

示例2: registerHooks

 public static function registerHooks()
 {
     \OCP\Util::connectHook('OC_Filesystem', 'post_rename', '\\OCA\\Files_Sharing\\Updater', 'renameHook');
     \OCP\Util::connectHook('OC_Filesystem', 'post_delete', '\\OCA\\Files_Sharing\\Hooks', 'unshareChildren');
     \OCP\Util::connectHook('OC_Appconfig', 'post_set_value', '\\OCA\\Files_Sharing\\Maintainer', 'configChangeHook');
     \OCP\Util::connectHook('OC_User', 'post_deleteUser', '\\OCA\\Files_Sharing\\Hooks', 'deleteUser');
 }
開發者ID:drognisep,項目名稱:Portfolio-Site,代碼行數:7,代碼來源:Helper.php

示例3: setUpBeforeClass

 public static function setUpBeforeClass()
 {
     // reset backend
     \OC_User::clearBackends();
     \OC_User::useBackend('database');
     // enable resharing
     \OC_Appconfig::setValue('core', 'shareapi_allow_resharing', 'yes');
     // clear share hooks
     \OC_Hook::clear('OCP\\Share');
     \OC::registerShareHooks();
     \OCP\Util::connectHook('OC_Filesystem', 'setup', '\\OC\\Files\\Storage\\Shared', 'setup');
     // Sharing related hooks
     \OCA\Encryption\Helper::registerShareHooks();
     // Filesystem related hooks
     \OCA\Encryption\Helper::registerFilesystemHooks();
     // clear and register hooks
     \OC_FileProxy::clearProxies();
     \OC_FileProxy::register(new OCA\Encryption\Proxy());
     // create users
     \Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1, true);
     \Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2, true);
     \Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER3, true);
     \Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER4, true);
     // create group and assign users
     \OC_Group::createGroup(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_GROUP1);
     \OC_Group::addToGroup(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER3, \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_GROUP1);
     \OC_Group::addToGroup(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER4, \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_GROUP1);
 }
開發者ID:CDN-Sparks,項目名稱:owncloud,代碼行數:28,代碼來源:share.php

示例4: __construct

 public function __construct(IL10N $l, ISession $session, ICrypto $crypto)
 {
     $this->session = $session;
     $this->crypto = $crypto;
     $this->setIdentifier('password::sessioncredentials')->setScheme(self::SCHEME_PASSWORD)->setText($l->t('Session credentials'))->addParameters([]);
     \OCP\Util::connectHook('OC_User', 'post_login', $this, 'authenticate');
 }
開發者ID:kenwi,項目名稱:core,代碼行數:7,代碼來源:sessioncredentials.php

示例5: setUpBeforeClass

 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     // note: not using a data provider because these
     // files all need to coexist to make sure the
     // share keys are found properly (pattern matching)
     self::$testFiles = array('t est.txt', 't est_.txt', 't est.doc.txt', 't est(.*).txt', 'multiple.dots.can.happen.too.txt', 't est.' . self::TEST_ENCRYPTION_HOOKS_USER1 . '.txt', 't est_.' . self::TEST_ENCRYPTION_HOOKS_USER1 . '.shareKey.txt', 'who would upload their.shareKey', 'user ones file.txt', 'user ones file.txt.backup', '.t est.txt');
     // reset backend
     \OC_User::clearBackends();
     \OC_User::useBackend('database');
     \OC_Hook::clear('OC_Filesystem');
     \OC_Hook::clear('OC_User');
     // clear share hooks
     \OC_Hook::clear('OCP\\Share');
     \OC::registerShareHooks();
     \OCP\Util::connectHook('OC_Filesystem', 'setup', '\\OC\\Files\\Storage\\Shared', 'setup');
     // Filesystem related hooks
     \OCA\Encryption\Helper::registerFilesystemHooks();
     // Sharing related hooks
     \OCA\Encryption\Helper::registerShareHooks();
     // clear and register proxies
     \OC_FileProxy::clearProxies();
     \OC_FileProxy::register(new OCA\Encryption\Proxy());
     // create test user
     self::loginHelper(\Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER1, true);
     self::loginHelper(\Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER2, true);
 }
開發者ID:droiter,項目名稱:openwrt-on-android,代碼行數:27,代碼來源:hooks.php

示例6: register

 public function register()
 {
     $loginRecord = function ($user) {
         $UserRole = \OC::$server->getConfig()->getUserValue(\OC_User::getUser(), "settings", "role", "undefined");
         Util::writeLog('core', "user:" . User::getDisplayName() . " role:" . $UserRole . " action:login success", Util::INFO);
     };
     $logoutRecord = function () {
         $UserRole = \OC::$server->getConfig()->getUserValue(\OC_User::getUser(), "settings", "role", "undefined");
         Util::writeLog('core', "user:" . User::getDisplayName() . " role:" . $this->UserRole . " action:logout success", Util::INFO);
     };
     $createRecord = function ($node) {
         $UserRole = \OC::$server->getConfig()->getUserValue(\OC_User::getUser(), "settings", "role", "undefined");
         Util::writeLog('activity', "user:" . User::getDisplayName() . " role:" . $UserRole . " action:creates " . $node->getName() . " success", Util::INFO);
     };
     $deleteRecord = function ($node) {
         $UserRole = \OC::$server->getConfig()->getUserValue(\OC_User::getUser(), "settings", "role", "undefined");
         Util::writeLog('activity', "user:" . User::getDisplayName() . " role:" . $UserRole . " action:deletes " . $node->getName() . " success", Util::INFO);
     };
     $renameRecord = function ($node) {
         $UserRole = \OC::$server->getConfig()->getUserValue(\OC_User::getUser(), "settings", "role", "undefined");
         Util::writeLog('activity', "user:" . User::getDisplayName() . " role:" . $UserRole . " action:renames " . $node->getName() . " success", Util::INFO);
     };
     $touchRecord = function ($node) {
         $UserRole = \OC::$server->getConfig()->getUserValue(\OC_User::getUser(), "settings", "role", "undefined");
         Util::writeLog('activity', "user:" . User::getDisplayName() . " role:" . $UserRole . " action:touches " . $node->getName() . " success", Util::INFO);
     };
     Util::connectHook('OCP\\Share', 'post_shared', 'OCA\\Activity_Logging\\UserHooks', 'share');
     $this->userManager->listen('\\OC\\User', 'postLogin', $loginRecord);
     $this->userManager->listen('\\OC\\User', 'logout', $logoutRecord);
     $this->UserFolder->listen('\\OC\\Files', 'postCreate', $createRecord);
     $this->UserFolder->listen('\\OC\\Files', 'postDelete', $deleteRecord);
     $this->UserFolder->listen('\\OC\\Files', 'postRename', $renameRecord);
 }
開發者ID:inwinstack,項目名稱:owncloud-activity_logging,代碼行數:33,代碼來源:userhooks.php

示例7: setUpBeforeClass

 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     // reset backend
     \OC_User::clearBackends();
     \OC_Group::clearBackends();
     // clear share hooks
     \OC_Hook::clear('OCP\\Share');
     \OC::registerShareHooks();
     \OCP\Util::connectHook('OC_Filesystem', 'setup', '\\OC\\Files\\Storage\\Shared', 'setup');
     // create users
     $backend = new \OC_User_Dummy();
     \OC_User::useBackend($backend);
     $backend->createUser(self::TEST_FILES_SHARING_API_USER1, self::TEST_FILES_SHARING_API_USER1);
     $backend->createUser(self::TEST_FILES_SHARING_API_USER2, self::TEST_FILES_SHARING_API_USER2);
     $backend->createUser(self::TEST_FILES_SHARING_API_USER3, self::TEST_FILES_SHARING_API_USER3);
     // create group
     $groupBackend = new \OC_Group_Dummy();
     $groupBackend->createGroup(self::TEST_FILES_SHARING_API_GROUP1);
     $groupBackend->createGroup('group');
     $groupBackend->addToGroup(self::TEST_FILES_SHARING_API_USER1, 'group');
     $groupBackend->addToGroup(self::TEST_FILES_SHARING_API_USER2, 'group');
     $groupBackend->addToGroup(self::TEST_FILES_SHARING_API_USER3, 'group');
     $groupBackend->addToGroup(self::TEST_FILES_SHARING_API_USER2, self::TEST_FILES_SHARING_API_GROUP1);
     \OC_Group::useBackend($groupBackend);
 }
開發者ID:adolfo2103,項目名稱:hcloudfilem,代碼行數:26,代碼來源:testcase.php

示例8: setup

 public function setup()
 {
     Util::connectHook('OC_User', 'post_createUser', $this, 'postCreateUser');
     Util::connectHook('OC_User', 'pre_deleteUser', $this, 'preDeleteUser');
     Util::connectHook('OC_User', 'post_deleteUser', $this, 'postDeleteUser');
     Util::connectHook('OC_User', 'changeUser', $this, 'changeUser');
 }
開發者ID:farukuzun,項目名稱:core-1,代碼行數:7,代碼來源:hookmanager.php

示例9: setUpBeforeClass

 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     // remember files_encryption state
     self::$stateFilesEncryption = \OC_App::isEnabled('files_encryption');
     //we don't want to tests with app files_encryption enabled
     \OC_App::disable('files_encryption');
     // reset backend
     \OC_User::clearBackends();
     \OC_User::useBackend('database');
     // clear share hooks
     \OC_Hook::clear('OCP\\Share');
     \OC::registerShareHooks();
     \OCP\Util::connectHook('OC_Filesystem', 'setup', '\\OC\\Files\\Storage\\Shared', 'setup');
     // create users
     $backend = new \OC_User_Dummy();
     \OC_User::useBackend($backend);
     $backend->createUser(self::TEST_FILES_SHARING_API_USER1, self::TEST_FILES_SHARING_API_USER1);
     $backend->createUser(self::TEST_FILES_SHARING_API_USER2, self::TEST_FILES_SHARING_API_USER2);
     $backend->createUser(self::TEST_FILES_SHARING_API_USER3, self::TEST_FILES_SHARING_API_USER3);
     // create group
     $groupBackend = new \OC_Group_Dummy();
     $groupBackend->createGroup(self::TEST_FILES_SHARING_API_GROUP1);
     $groupBackend->createGroup('group');
     $groupBackend->addToGroup(self::TEST_FILES_SHARING_API_USER1, 'group');
     $groupBackend->addToGroup(self::TEST_FILES_SHARING_API_USER2, 'group');
     $groupBackend->addToGroup(self::TEST_FILES_SHARING_API_USER3, 'group');
     $groupBackend->addToGroup(self::TEST_FILES_SHARING_API_USER2, self::TEST_FILES_SHARING_API_GROUP1);
     \OC_Group::useBackend($groupBackend);
 }
開發者ID:heldernl,項目名稱:owncloud8-extended,代碼行數:30,代碼來源:testcase.php

示例10: register

 /**
  * Registers the filesystem hooks for basic filesystem operations.
  * All other events has to be triggered by the apps.
  */
 public static function register()
 {
     Util::connectHook('OC_Filesystem', 'post_create', 'OCA\\Activity\\FilesHooksStatic', 'fileCreate');
     Util::connectHook('OC_Filesystem', 'post_update', 'OCA\\Activity\\FilesHooksStatic', 'fileUpdate');
     Util::connectHook('OC_Filesystem', 'delete', 'OCA\\Activity\\FilesHooksStatic', 'fileDelete');
     Util::connectHook('\\OCA\\Files_Trashbin\\Trashbin', 'post_restore', 'OCA\\Activity\\FilesHooksStatic', 'fileRestore');
     Util::connectHook('OCP\\Share', 'post_shared', 'OCA\\Activity\\FilesHooksStatic', 'share');
 }
開發者ID:samj1912,項目名稱:repo,代碼行數:12,代碼來源:fileshooksstatic.php

示例11: addHooks

 /**
  * Connects Hooks
  *
  * @return null
  */
 public function addHooks()
 {
     OCUtil::connectHook('OC_User', 'post_login', $this, 'login');
     OCUtil::connectHook('OC_User', 'logout', $this, 'logout');
     OCUtil::connectHook('OC_User', 'post_setPassword', $this, 'setPassphrase');
     OCUtil::connectHook('OC_User', 'pre_setPassword', $this, 'preSetPassphrase');
     OCUtil::connectHook('OC_User', 'post_createUser', $this, 'postCreateUser');
     OCUtil::connectHook('OC_User', 'post_deleteUser', $this, 'postDeleteUser');
 }
開發者ID:Kevin-ZK,項目名稱:vaneDisk,代碼行數:14,代碼來源:userhooks.php

示例12: setUp

 public function setUp()
 {
     self::$hookCalls = array();
     $config = \OC::$server->getConfig();
     $this->dataDir = $config->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data/');
     \OC_Mount_Config::$skipTest = true;
     \OCP\Util::connectHook(Filesystem::CLASSNAME, Filesystem::signal_create_mount, get_class($this), 'createHookCallback');
     \OCP\Util::connectHook(Filesystem::CLASSNAME, Filesystem::signal_delete_mount, get_class($this), 'deleteHookCallback');
 }
開發者ID:Kevin-ZK,項目名稱:vaneDisk,代碼行數:9,代碼來源:storagesservicetest.php

示例13: connectHooks

 public function connectHooks()
 {
     \OCP\Util::connectHook('OC_User', 'pre_setPassword', $this, 'pre_setPasswordHook');
     \OCP\Util::connectHook('OC_User', 'post_setPassword', $this, 'post_setPasswordHook');
     \OCP\Util::connectHook('OC_User', 'pre_createUser', $this, 'pre_createUserHook');
     \OCP\Util::connectHook('OC_User', 'post_createUser', $this, 'post_createUserHook');
     \OCP\Util::connectHook('OC_User', 'pre_deleteUser', $this, 'pre_deleteUserHook');
     \OCP\Util::connectHook('OC_User', 'post_deleteUser', $this, 'post_deleteUserHook');
 }
開發者ID:GitHubUser4234,項目名稱:apps,代碼行數:9,代碼來源:hooks.php

示例14: setUpHooks

 public static function setUpHooks()
 {
     self::clear();
     \OCP\Util::connectHook(Filesystem::CLASSNAME, Filesystem::signal_create, '\\Test\\HookHelper', 'createCallback');
     \OCP\Util::connectHook(Filesystem::CLASSNAME, Filesystem::signal_update, '\\Test\\HookHelper', 'updateCallback');
     \OCP\Util::connectHook(Filesystem::CLASSNAME, Filesystem::signal_write, '\\Test\\HookHelper', 'writeCallback');
     \OCP\Util::connectHook(Filesystem::CLASSNAME, Filesystem::signal_post_create, '\\Test\\HookHelper', 'postCreateCallback');
     \OCP\Util::connectHook(Filesystem::CLASSNAME, Filesystem::signal_post_update, '\\Test\\HookHelper', 'postUpdateCallback');
     \OCP\Util::connectHook(Filesystem::CLASSNAME, Filesystem::signal_post_write, '\\Test\\HookHelper', 'postWriteCallback');
 }
開發者ID:rchicoli,項目名稱:owncloud-core,代碼行數:10,代碼來源:HookHelper.php

示例15: register

 /**
  * Registers the filesystem hooks for basic filesystem operations.
  * All other events has to be triggered by the apps.
  */
 public static function register()
 {
     Util::connectHook('OC_Filesystem', 'post_create', 'OCA\\Activity\\FilesHooksStatic', 'fileCreate');
     Util::connectHook('OC_Filesystem', 'post_update', 'OCA\\Activity\\FilesHooksStatic', 'fileUpdate');
     Util::connectHook('OC_Filesystem', 'delete', 'OCA\\Activity\\FilesHooksStatic', 'fileDelete');
     Util::connectHook('\\OCA\\Files_Trashbin\\Trashbin', 'post_restore', 'OCA\\Activity\\FilesHooksStatic', 'fileRestore');
     Util::connectHook('OCP\\Share', 'post_shared', 'OCA\\Activity\\FilesHooksStatic', 'share');
     $eventDispatcher = \OC::$server->getEventDispatcher();
     $eventDispatcher->addListener('OCA\\Files::loadAdditionalScripts', ['OCA\\Activity\\FilesHooksStatic', 'onLoadFilesAppScripts']);
 }
開發者ID:enoch85,項目名稱:owncloud-testserver,代碼行數:14,代碼來源:fileshooksstatic.php


注:本文中的OCP\Util::connectHook方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。