• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP EventManager类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中EventManager的典型用法代码示例。如果您正苦于以下问题:PHP EventManager类的具体用法?PHP EventManager怎么用?PHP EventManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了EventManager类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: itFallbackToCallHookIfGivenCallbackDoesNotExist

 public function itFallbackToCallHookIfGivenCallbackDoesNotExist()
 {
     $event = 'an_event';
     $params = array('some_params');
     $listener = new Event2MockEventListener($this);
     stub($listener)->CallHook($event, $params)->once();
     $em = new EventManager();
     $em->addListener($event, $listener, 'doSomething', false);
     $em->processEvent($event, $params);
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:10,代码来源:EventManagerTest.php


示例2: __viewIndexEventNames

 public function __viewIndexEventNames($context)
 {
     $EventManager = new EventManager($this->_Parent);
     $events = $EventManager->listAll();
     $options = array();
     foreach ($events as $event) {
         $selected = $this->_driver->isEventNameSelected($event['handle']);
         $options[] = array($event['handle'], $selected, $event['name']);
     }
     $section = Widget::Label('Selected');
     $section->appendChild(Widget::Select('settings[event-names][]', $options, array('multiple' => 'multiple')));
     $context->appendChild($section);
 }
开发者ID:bauhouse,项目名称:sym-extensions,代码行数:13,代码来源:content.preferences.php


示例3: run

 function run()
 {
     try {
         $repository = new SapphireEventRepository();
         $tx_manager = SapphireTransactionManager::getInstance();
         $event_manager = new EventManager($repository, new EventRegistrationRequestFactory(), null, new SapphireEventPublishingService(), new EventValidatorFactory(), $tx_manager);
         $rss_events = $event_manager->rssEvents(10000);
         $events_array = $event_manager->rss2events($rss_events);
         $event_manager->saveRssEvents($events_array);
         return 'OK';
     } catch (Exception $ex) {
         SS_Log::log($ex, SS_Log::ERR);
         echo $ex->getMessage();
     }
 }
开发者ID:rbowen,项目名称:openstack-org,代码行数:15,代码来源:RssEventsDigestTask.php


示例4: _content

 function _content($params)
 {
     if (isset($params['version_number'])) {
         $version_factory =& $this->_getVersionFactory($params);
         $version =& $version_factory->getSpecificVersion($params['item'], $params['version_number']);
     } else {
         $version =& $params['item']->getCurrentVersion();
     }
     if ($version) {
         if (file_exists($version->getPath())) {
             $event_manager =& EventManager::instance();
             $event_manager->processEvent('plugin_docman_event_access', array('group_id' => $params['group_id'], 'item' => &$params['item'], 'version' => $version->getNumber(), 'user' => &$params['user']));
             $mime = explode('/', $version->getFiletype());
             if (in_array($mime[1], array('plain', 'css', 'javascript'))) {
                 $balise = 'pre';
             } else {
                 $balise = 'div';
             }
             echo '<' . $balise . ' class="docman_embedded_file_content">';
             echo $this->hp->purify(file_get_contents($version->getPath()), CODENDI_PURIFIER_FULL);
             echo '</' . $balise . '>';
         } else {
             $this->_controller->feedback->log('error', $GLOBALS['Language']->getText('plugin_docman', 'error_filenotfound'));
             $v =& new Docman_View_DocmanError($this->_controller);
             $v->display($params);
         }
     }
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:28,代码来源:Docman_View_Embedded.class.php


示例5: initializeEvents

 private function initializeEvents()
 {
     EventManager::bind("GetGroupForumsMessageEvent");
     EventManager::bind("GetGroupForumDataMessageEvent");
     EventManager::bind("GetGroupForumThreadRootMessageEvent");
     EventManager::bind("UpdateThreadMessageEvent");
     EventManager::bind("UpdateForumSettingsMessageEvent");
     EventManager::bind("AlterForumThreadStateMessageEvent");
     EventManager::bind("PublishForumThreadMessageEvent");
     EventManager::bind("ReadForumThreadMessageEvent");
     EventManager::bind("RequestLeaveGroupMessageEvent");
     EventManager::bind("ConfirmLeaveGroupMessageEvent");
     EventManager::bind("AcceptGroupRequestMessageEvent");
     EventManager::bind("CreateGuildMessageEvent");
     EventManager::bind("GetGroupFurnitureMessageEvent");
     EventManager::bind("GetGroupInfoMessageEvent");
     EventManager::bind("GetGroupMembersMessageEvent");
     EventManager::bind("GetGroupPurchaseBoxMessageEvent");
     EventManager::bind("GetGroupPurchasingInfoMessageEvent");
     EventManager::bind("GroupDeclineMembershipRequestMessageEvent");
     EventManager::bind("GroupMakeAdministratorMessageEvent");
     EventManager::bind("GroupManageMessageEvent");
     EventManager::bind("GroupUpdateBadgeMessageEvent");
     EventManager::bind("GroupUpdateColoursMessageEvent");
     EventManager::bind("GroupUpdateNameMessageEvent");
     EventManager::bind("GroupUpdateSettingsMessageEvent");
     EventManager::bind("GroupUserJoinMessageEvent");
     EventManager::bind("SetFavoriteGroupMessageEvent");
     EventManager::bind("RemoveFavouriteGroupMessageEvent");
     EventManager::bind("RemoveGroupAdminMessageEvent");
     EventManager::bind("DeleteGroupMessageEvent");
 }
开发者ID:BurakDev,项目名称:BloonJPHP,代码行数:32,代码来源:GroupEvents.php


示例6: tearDown

 public function tearDown() {
     unlink($GLOBALS['alias_file']);
     unset($GLOBALS['alias_file']);
     //clear the cache between each tests
     Backend::clearInstances();
     EventManager::clearInstance();
 }
开发者ID:rinodung,项目名称:tuleap,代码行数:7,代码来源:BackendAliasesTest.php


示例7: getContent

 public function getContent()
 {
     $request =& HTTPRequest::instance();
     $group_id = $request->get('group_id');
     $pm = ProjectManager::instance();
     $project = $pm->getProject($group_id);
     $res_admin = db_query("SELECT user.user_id AS user_id,user.user_name AS user_name, user.realname as realname " . "FROM user,user_group " . "WHERE user_group.user_id=user.user_id AND user_group.group_id=" . db_ei($group_id) . " AND " . "user_group.admin_flags = 'A'");
     if (db_numrows($res_admin) > 0) {
         $user_helper = UserHelper::instance();
         $hp = Codendi_HTMLPurifier::instance();
         $em = EventManager::instance();
         echo '<span class="develtitle">' . $GLOBALS['Language']->getText('include_project_home', 'proj_admins') . ':</span><br />';
         while ($row_admin = db_fetch_array($res_admin)) {
             $display_name = '';
             $em->processEvent('get_user_display_name', array('user_id' => $row_admin['user_id'], 'user_name' => $row_admin['user_name'], 'realname' => $row_admin['realname'], 'user_display_name' => &$display_name));
             if (!$display_name) {
                 $display_name = $hp->purify($user_helper->getDisplayNameFromUserId($row_admin['user_id']));
             }
             echo '<a href="/users/' . $row_admin['user_name'] . '/">' . $display_name . '</a><br />';
         }
     }
     echo '<span class="develtitle">' . $GLOBALS['Language']->getText('include_project_home', 'proj_members') . ':</span><br />';
     // count of developers on this project
     $res_count = db_query("SELECT user_id FROM user_group WHERE group_id=" . db_ei($group_id));
     echo db_numrows($res_count);
     echo ' <a href="/project/memberlist.php?group_id=' . $group_id . '">[' . $GLOBALS['Language']->getText('include_project_home', 'view_members') . ']</a>';
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:27,代码来源:Widget_ProjectMembers.class.php


示例8: build

 /** @return User_LoginPresenter */
 public function build($return_to, $printer_version, $form_loginname)
 {
     $presenter = new User_LoginPresenter($return_to, $printer_version, $form_loginname, $this->getToggleSSL());
     $authoritative = false;
     EventManager::instance()->processEvent('login_presenter', array('presenter' => &$presenter, 'authoritative' => &$authoritative));
     return $presenter;
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:8,代码来源:LoginPresenterBuilder.php


示例9: __construct

 protected function __construct()
 {
     $this->charts = null;
     $this->chart_factories = array();
     $em = EventManager::instance();
     $em->processEvent('graphontrackersv5_load_chart_factories', array('factories' => &$this->chart_factories));
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:7,代码来源:GraphOnTrackersV5_ChartFactory.class.php


示例10: initializeEvents

 private function initializeEvents()
 {
     EventManager::bind("WiredSaveConditionMessageEvent");
     EventManager::bind("WiredSaveEffectMessageEvent");
     EventManager::bind("WiredSaveMatchingMessageEvent");
     EventManager::bind("WiredSaveTriggerMessageEvent");
 }
开发者ID:BurakDev,项目名称:BloonJPHP,代码行数:7,代码来源:RoomWiredEvents.php


示例11: initializeEvents

 private function initializeEvents()
 {
     EventManager::bind("EnterPrivateRoomMessageEvent");
     EventManager::bind("RoomGetHeightmapMessageEvent");
     EventManager::bind("RoomGetInfoMessageEvent");
     EventManager::bind("RoomUserActionMessageEvent");
     EventManager::bind("RoomOnLoadMessageEvent");
     EventManager::bind("RoomDeleteMessageEvent");
     EventManager::bind("RoomEventUpdateMessageEvent");
     EventManager::bind("RoomGetSettingsInfoMessageEvent");
     EventManager::bind("RoomSaveSettingsMessageEvent");
     EventManager::bind("RoomSettingsMuteAllMessageEvent");
     EventManager::bind("RoomSettingsMuteUserMessageEvent");
     EventManager::bind("RoomLoadByDoorbellMessageEvent");
     EventManager::bind("DoorbellAnswerMessageEvent");
     EventManager::bind("RoomGetFilterMessageEvent");
     EventManager::bind("RoomAlterFilterMessageEvent");
     EventManager::bind("GetRoomBannedUsersMessageEvent");
     EventManager::bind("GetRoomRightsListMessageEvent");
     EventManager::bind("RoomRemoveAllRightsMessageEvent");
     EventManager::bind("RoomRemoveUserRightsMessageEvent");
     EventManager::bind("GetFloorPlanFurnitureMessageEvent");
     EventManager::bind("GetFloorPlanDoorMessageEvent");
     EventManager::bind("SaveFloorPlanEditorMessageEvent");
     EventManager::bind("SaveRoomThumbnailMessageEvent");
     EventManager::bind("SetInvitationsPreferenceMessageEvent");
     EventManager::bind("SubmitRoomToCompetitionMessageEvent");
     EventManager::bind("VoteForRoomMessageEvent");
 }
开发者ID:BurakDev,项目名称:BloonJPHP,代码行数:29,代码来源:RoomEvents.php


示例12: initializeEvents

 private function initializeEvents()
 {
     EventManager::bind("GetCatalogIndexMessageEvent");
     EventManager::bind("GetCatalogPageMessageEvent");
     EventManager::bind("GetCatalogClubPageMessageEvent");
     EventManager::bind("GetCatalogOfferMessageEvent");
     EventManager::bind("CatalogueOfferConfigMessageEvent");
     EventManager::bind("PurchaseFromCatalogMessageEvent");
     EventManager::bind("PurchaseFromCatalogAsGiftMessageEvent");
     EventManager::bind("GetSellablePetBreedsMessageEvent");
     EventManager::bind("ReloadRecyclerMessageEvent");
     EventManager::bind("GetGiftWrappingConfigurationMessageEvent");
     EventManager::bind("GetRecyclerRewardsMessageEvent");
     EventManager::bind("CatalogPromotionGetRoomsMessageEvent");
     EventManager::bind("GetCatalogClubGiftsMessageEvent");
     EventManager::bind("ChooseClubGiftMessageEvent");
     EventManager::bind("PromoteRoomMessageEvent");
     EventManager::bind("RetrieveSongIDMessageEvent");
     EventManager::bind("CheckPetnameMessageEvent");
     EventManager::bind("EcotronRecycleMessageEvent");
     EventManager::bind("RedeemVoucherMessageEvent");
     EventManager::bind("BuildersClubUpdateFurniCount");
     EventManager::bind("PlaceBuildersFurniture");
     EventManager::bind("PurchaseTargetedOfferMessageEvent");
 }
开发者ID:BurakDev,项目名称:BloonJPHP,代码行数:25,代码来源:CatalogEvents.php


示例13: testListener

 public function testListener()
 {
     $subject1 = $this->getMockBuilder('Jivoo\\Core\\EventSubject')->getMock();
     $subject1->method('getEvents')->willReturn(array('someEvent'));
     $subject2 = $this->getMockBuilder('Jivoo\\Core\\EventSubject')->getMock();
     $subject2->method('getEvents')->willReturn(array('someEvent'));
     $em1 = new EventManager($subject1);
     $em2 = new EventManager($subject2, $em1);
     $l = $this->getMockBuilder('Jivoo\\Core\\EventListener')->setMethods(array('getEventHandlers', 'someEvent'))->getMock();
     $l->method('getEventHandlers')->wilLReturn(array(get_class($subject2) . '.someEvent'));
     $l->expects($this->once())->method('someEvent')->willReturn(false);
     $em1->attachListener($l);
     $this->assertFalse($em2->trigger('someEvent'));
     $em1->detachListener($l);
     $this->assertTrue($em2->trigger('someEvent'));
 }
开发者ID:jivoo,项目名称:jivoo,代码行数:16,代码来源:EventManagerTest.php


示例14: instance

 /**
  * The singleton method
  *
  * @return EventManager
  */
 public static function instance()
 {
     if (!self::$instance) {
         self::$instance = new EventManager();
     }
     return self::$instance;
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:12,代码来源:EventManager.class.php


示例15: display_remove_button

/**
 * Say if we can display the remove button on a wiki page
 * 
 * The wiki page may be driven by another item in the forge (eg a docman document),
 * therefore wiki administrator shouldn't be able to remove the page.
 * 
 * @return bool
 */
function display_remove_button($pagename)
{
    $display_remove_button = true;
    $em = EventManager::instance();
    $em->processEvent(Event::WIKI_DISPLAY_REMOVE_BUTTON, array('display_remove_button' => &$display_remove_button, 'group_id' => GROUP_ID, 'wiki_page' => $pagename));
    return $display_remove_button;
}
开发者ID:pombredanne,项目名称:tuleap,代码行数:15,代码来源:codendi.php


示例16: handleGetEvents

 public function handleGetEvents()
 {
     $student = $this->getUser()->getIdentity()->student;
     $events = EventManager::getEvents($student);
     fd($events);
     $this->terminate(new JsonResponse($events));
 }
开发者ID:bazo,项目名称:diplomovka,代码行数:7,代码来源:DefaultPresenter.php


示例17: getProcessForQueue

 public function getProcessForQueue($request_queue)
 {
     $owner = SystemEvent::OWNER_APP;
     $custom_queues = array();
     $this->event_manager->processEvent(Event::SYSTEM_EVENT_GET_CUSTOM_QUEUES, array('queues' => &$custom_queues));
     if (isset($custom_queues[$request_queue])) {
         $this->logger = $custom_queues[$request_queue]->getLogger();
         $this->logger->debug('Processing ' . $request_queue . ' queue.');
         $process = new SystemEventProcessCustomQueue($request_queue);
         $owner = $custom_queues[$request_queue]->getOwner();
     } else {
         switch ($request_queue) {
             case SystemEvent::OWNER_APP:
                 $this->logger->debug('Processing default queue as app user.');
                 $process = new SystemEventProcessApplicationOwnerDefaultQueue();
                 break;
             case SystemEvent::DEFAULT_QUEUE:
                 $this->logger->debug('Processing default queue as root user.');
                 $owner = SystemEvent::OWNER_ROOT;
                 $process = new SystemEventProcessRootDefaultQueue();
                 break;
             default:
                 $this->logger->debug('Ignoring ' . $request_queue . ' queue.');
                 exit(0);
         }
     }
     if ($owner === SystemEvent::OWNER_APP) {
         return new SystemEventProcessor_ApplicationOwner($process, $this->system_event_manager, new SystemEventDao(), $this->logger);
     }
     return new SystemEventProcessor_Root($process, $this->system_event_manager, new SystemEventDao(), $this->logger, Backend::instance('Aliases'), Backend::instance('CVS'), Backend::instance('SVN'), Backend::instance('System'), new SiteCache($this->logger));
 }
开发者ID:ansarbek,项目名称:tuleap,代码行数:31,代码来源:SystemEventProcessor_Factory.php


示例18: getStatistics

 public function getStatistics($statistic_name, $date_start, $date_end)
 {
     $statistics_data = array();
     $params = array('statistic_name' => $statistic_name, 'date_start' => $date_start, 'date_end' => $date_end, 'result' => &$statistics_data);
     $this->event_manager->processEvent('get_statistics_aggregation', $params);
     return $statistics_data;
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:7,代码来源:AgileDashboardStatisticsAggregator.class.php


示例19: getModFromPlugins

 private function getModFromPlugins(array $project_info, $requested_authentication_method, $project_authorizes_tokens)
 {
     $svn_apache_auth = null;
     $params = array('svn_apache_auth' => &$svn_apache_auth, 'svn_conf_auth' => $requested_authentication_method, 'project_authorizes_tokens' => $project_authorizes_tokens, 'project_info' => $project_info);
     $this->event_manager->processEvent(Event::SVN_APACHE_AUTH, $params);
     return $svn_apache_auth;
 }
开发者ID:blestab,项目名称:tuleap,代码行数:7,代码来源:SVN_Apache_Auth_Factory.class.php


示例20: getMilestoneRepresentation

 public function getMilestoneRepresentation(Planning_Milestone $milestone, PFUser $user)
 {
     $milestone_representation = new MilestoneRepresentation();
     $milestone_representation->build($milestone, $this->milestone_factory->getMilestoneStatusCount($user, $milestone), $this->getBacklogTrackers($milestone), $this->milestone_factory->userCanChangePrioritiesInMilestone($milestone, $user));
     $this->event_manager->processEvent(AGILEDASHBOARD_EVENT_REST_GET_MILESTONE, array('version' => 'v1', 'user' => $user, 'milestone' => $milestone, 'milestone_representation' => &$milestone_representation));
     return $milestone_representation;
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:7,代码来源:MilestoneRepresentationBuilder.class.php



注:本文中的EventManager类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP EventUtil类代码示例发布时间:2022-05-23
下一篇:
PHP EventLog类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap