当前位置: 首页>>代码示例>>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;未经允许,请勿转载。