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


PHP Setup::EventDistributionConfiguration方法代码示例

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


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

示例1: RunWorkflow

 public function RunWorkflow($key)
 {
     $logger = \Swiftriver\Core\Setup::GetLogger();
     $logger->log("Core::Workflows::EventHandlers::ListAllEventHandlers::RunWorkflow [Method invoked]", \PEAR_LOG_INFO);
     $logger->log("Core::Workflows::EventHandlers::ListAllEventHandlers::RunWorkflow [START: Constructing the Event Distributor]", \PEAR_LOG_DEBUG);
     $eventDistributer = new \Swiftriver\Core\EventDistribution\EventDistributor();
     $logger->log("Core::Workflows::EventHandlers::ListAllEventHandlers::RunWorkflow [END: Constructing the Event Distributor]", \PEAR_LOG_DEBUG);
     $logger->log("Core::Workflows::EventHandlers::ListAllEventHandlers::RunWorkflow [START: Getting a full list of Event Handlers from the event distributor]", \PEAR_LOG_DEBUG);
     $handlers = $eventDistributer->ListAllAvailableEventHandlers();
     $logger->log("Core::Workflows::EventHandlers::ListAllEventHandlers::RunWorkflow [END: Getting a full list of Event Handlers from the event distributor]", \PEAR_LOG_DEBUG);
     $logger->log("Core::Workflows::EventHandlers::ListAllEventHandlers::RunWorkflow [START: Finding out which event handlers are active]", \PEAR_LOG_DEBUG);
     $config = \Swiftriver\Core\Setup::EventDistributionConfiguration();
     $activeHandlers = $config->EventHandlers;
     if ($activeHandlers != null && is_array($activeHandlers) && $handlers != null && is_array($handlers)) {
         foreach ($activeHandlers as $activeHandler) {
             foreach ($handlers as $handler) {
                 if ($handler->Name() == $activeHandler->name) {
                     $handler->active = true;
                 }
             }
         }
     }
     $logger->log("Core::Workflows::EventHandlers::ListAllEventHandlers::RunWorkflow [END: Finding out which event handlers are active]", \PEAR_LOG_DEBUG);
     $logger->log("Core::Workflows::EventHandlers::ListAllEventHandlers::RunWorkflow [START: Parsing the handlers to JSON]", \PEAR_LOG_DEBUG);
     $json = parent::ParseHandlersToJson($handlers);
     $logger->log("Core::Workflows::EventHandlers::ListAllEventHandlers::RunWorkflow [END: Parsing the handlers to JSON]", \PEAR_LOG_DEBUG);
     $logger->log("Core::Workflows::EventHandlers::ListAllEventHandlers::RunWorkflow [Method finished]", \PEAR_LOG_INFO);
     return parent::FormatReturn($json);
 }
开发者ID:ushahidi,项目名称:Swiftriver-2011,代码行数:29,代码来源:ListAllEventHandlers.php

示例2: RunWorkflow

 public function RunWorkflow($json, $key)
 {
     $logger = \Swiftriver\Core\Setup::GetLogger();
     $logger->log("Core::Workflows::EventHandlers::ActivateEventHandlers::RunWorkflow [Method invoked]", \PEAR_LOG_INFO);
     $logger->log("Core::Workflows::EventHandlers::ActivateEventHandlers::RunWorkflow [START: Parsing the JSON input]", \PEAR_LOG_DEBUG);
     try {
         $name = parent::ParseJsonToEventHandlerName($json);
     } catch (\Exception $e) {
         $logger->log("Core::Workflows::EventHandlers::ActivateEventHandlers::RunWorkflow [An exception was thrown]", \PEAR_LOG_DEBUG);
         $logger->log("Core::Workflows::EventHandlers::ActivateEventHandlers::RunWorkflow [{$e}]", \PEAR_LOG_ERR);
         return parent::FormatErrorMessage($e);
     }
     $logger->log("Core::Workflows::EventHandlers::ActivateEventHandlers::RunWorkflow [END: Parsing the JSON input]", \PEAR_LOG_DEBUG);
     $logger->log("Core::Workflows::EventHandlers::ActivateEventHandlers::RunWorkflow [START: Instanciating the event distributor]", \PEAR_LOG_DEBUG);
     $eventDistributor = new \Swiftriver\Core\EventDistribution\EventDistributor();
     $logger->log("Core::Workflows::EventHandlers::ActivateEventHandlers::RunWorkflow [END: Instanciating the event distributor]", \PEAR_LOG_DEBUG);
     $logger->log("Core::Workflows::EventHandlers::ActivateEventHandlers::RunWorkflow [START: Getting all the availabel event handlers]", \PEAR_LOG_DEBUG);
     $handlers = $eventDistributor->ListAllAvailableEventHandlers();
     $logger->log("Core::Workflows::EventHandlers::ActivateEventHandlers::RunWorkflow [END: Getting all the availabel event handlers]", \PEAR_LOG_DEBUG);
     $logger->log("Core::Workflows::EventHandlers::ActivateEventHandlers::RunWorkflow [START: Looking for a handler with the matching name]", \PEAR_LOG_DEBUG);
     foreach ($handlers as $handler) {
         if ($handler->Name() == $name) {
             $thisHandler = $handler;
         }
     }
     $logger->log("Core::Workflows::EventHandlers::ActivateEventHandlers::RunWorkflow [END: Looking for a handler with the matching name]", \PEAR_LOG_DEBUG);
     if (!isset($thisHandler) || $thisHandler == null) {
         return parent::FormatErrorMessage("No event handler found matching the name {$name}");
     }
     $logger->log("Core::Workflows::EventHandlers::ActivateEventHandlers::RunWorkflow [START: Constructing the configuration entry]", \PEAR_LOG_DEBUG);
     $className = $thisHandler->type;
     $filePath = $thisHandler->filePath;
     $configEntry = new \Swiftriver\Core\ObjectModel\EventHandlerEntry($name, $className, $filePath);
     $logger->log("Core::Workflows::EventHandlers::ActivateEventHandlers::RunWorkflow [END: Constructing the configuration entry]", \PEAR_LOG_DEBUG);
     $logger->log("Core::Workflows::EventHandlers::ActivateEventHandlers::RunWorkflow [START: Extracting the configured event handlers from the config system]", \PEAR_LOG_DEBUG);
     $config = \Swiftriver\Core\Setup::EventDistributionConfiguration();
     $configuredEventHandlers = $config->EventHandlers;
     $logger->log("Core::Workflows::EventHandlers::ActivateEventHandlers::RunWorkflow [END: Extracting the configured event handlers from the config system]", \PEAR_LOG_DEBUG);
     $logger->log("Core::Workflows::EventHandlers::ActivateEventHandlers::RunWorkflow [START: Looking for an existing config entry for this handler]", \PEAR_LOG_DEBUG);
     for ($i = 0; $i < count($configuredEventHandlers); $i++) {
         if ($configuredEventHandlers[$i]->name == $name) {
             $index = $i;
         }
     }
     $logger->log("Core::Workflows::EventHandlers::ActivateEventHandlers::RunWorkflow [END: Looking for an existing config entry for this handler]", \PEAR_LOG_DEBUG);
     $logger->log("Core::Workflows::EventHandlers::ActivateEventHandlers::RunWorkflow [START: Adding a configuration entry for this event handler]", \PEAR_LOG_DEBUG);
     if (isset($index)) {
         $configuredEventHandlers[$index] = $configEntry;
     } else {
         $configuredEventHandlers[] = $configEntry;
     }
     $logger->log("Core::Workflows::EventHandlers::ActivateEventHandlers::RunWorkflow [END: Adding a configuration entry for this event handler]", \PEAR_LOG_DEBUG);
     $logger->log("Core::Workflows::EventHandlers::ActivateEventHandlers::RunWorkflow [START: Saving the configuration]", \PEAR_LOG_DEBUG);
     $config->EventHandlers = $configuredEventHandlers;
     $config->Save();
     $logger->log("Core::Workflows::EventHandlers::ActivateEventHandlers::RunWorkflow [END: Saving the configuration]", \PEAR_LOG_DEBUG);
     $logger->log("Core::Workflows::EventHandlers::ActivateEventHandlers::RunWorkflow [Method finished]", \PEAR_LOG_INFO);
     return parent::FormatMessage("OK");
 }
开发者ID:ushahidi,项目名称:Swiftriver-2011,代码行数:59,代码来源:ActivateEventHandler.php

示例3: __construct

 /**
  * The constructor for the EventDistributor class
  */
 public function __construct()
 {
     $logger = \Swiftriver\Core\Setup::GetLogger();
     $logger->log("Core::EventDistribution::EventDistributor::__construct [Method invoked]", \PEAR_LOG_DEBUG);
     $logger->log("Core::EventDistribution::EventDistributor::__construct [START: Adding configured event handlers]", \PEAR_LOG_DEBUG);
     $this->eventHandlers = \Swiftriver\Core\Setup::EventDistributionConfiguration()->EventHandlers;
     $logger->log("Core::EventDistribution::EventDistributor::__construct [END: Adding configured event handlers]", \PEAR_LOG_DEBUG);
     $logger->log("Core::EventDistribution::EventDistributor::__construct [Method finished]", \PEAR_LOG_DEBUG);
 }
开发者ID:ushahidi,项目名称:Swiftriver-2011,代码行数:12,代码来源:EventDistributor.php


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