当前位置: 首页>>代码示例>>PHP>>正文


PHP DevblocksPlatform::getEventRegistry方法代码示例

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


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

示例1: trigger

 function trigger(Model_DevblocksEvent $event)
 {
     /*
      * [TODO] Look at the hash and spawn our listeners for this particular point
      */
     $events = DevblocksPlatform::getEventRegistry();
     if (null == ($listeners = @$events[$event->id])) {
         $listeners = array();
     }
     // [TODO] Make sure we can't get a double listener
     if (isset($events['*']) && is_array($events['*'])) {
         foreach ($events['*'] as $evt) {
             $listeners[] = $evt;
         }
     }
     if (is_array($listeners) && !empty($listeners)) {
         foreach ($listeners as $listener) {
             /* @var $listener DevblocksExtensionManifest */
             // Extensions can be invoked on these plugins even by workers who cannot see them
             if (null != ($manifest = DevblocksPlatform::getExtension($listener, false, true))) {
                 if (method_exists($manifest, 'createInstance')) {
                     $inst = $manifest->createInstance();
                     /* @var $inst DevblocksEventListenerExtension */
                     if ($inst instanceof DevblocksEventListenerExtension) {
                         $inst->handleEvent($event);
                     }
                 }
             }
         }
     }
 }
开发者ID:jstanden,项目名称:devblocks,代码行数:31,代码来源:Devblocks.class.php

示例2: trigger

 function trigger(Model_DevblocksEvent $event)
 {
     /*
      * [TODO] Look at the hash and spawn our listeners for this particular point
      */
     $events = DevblocksPlatform::getEventRegistry();
     if (null == ($listeners = @$events[$event->id])) {
         $listeners = array();
     }
     // [TODO] Make sure we can't get a double listener
     if (is_array($events['*'])) {
         foreach ($events['*'] as $evt) {
             $listeners[] = $evt;
         }
     }
     if (is_array($listeners) && !empty($listeners)) {
         foreach ($listeners as $listener) {
             /* @var $listener DevblocksExtensionManifest */
             $manifest = DevblocksPlatform::getExtension($listener);
             $inst = $manifest->createInstance();
             /* @var $inst DevblocksEventListenerExtension */
             $inst->handleEvent($event);
         }
     }
 }
开发者ID:sluther,项目名称:portsensor,代码行数:25,代码来源:Engine.php


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