本文整理汇总了PHP中EventManager::processEvent方法的典型用法代码示例。如果您正苦于以下问题:PHP EventManager::processEvent方法的具体用法?PHP EventManager::processEvent怎么用?PHP EventManager::processEvent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EventManager
的用法示例。
在下文中一共展示了EventManager::processEvent方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例2: 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));
}
示例3: 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;
}
示例4: 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;
}
示例5: update
public function update(Codendi_Request $request, Response $response)
{
$emailgateway_mode = $request->get('emailgateway_mode');
if ($emailgateway_mode && $this->config->setEmailgatewayMode($emailgateway_mode)) {
$response->addFeedback(Feedback::INFO, $GLOBALS['Language']->getText('plugin_tracker_config', 'successfully_updated'));
}
$this->event_manager->processEvent(Event::UPDATE_ALIASES, null);
$response->redirect($_SERVER['REQUEST_URI']);
}
示例6: import
/**
* Import cardwall ontop from XML input
*
* @param SimpleXMLElement $xml_input
* @throws CardwallFromXmlImportCannotBeEnabledException
*/
public function import(SimpleXMLElement $xml_input)
{
if (!$xml_input->{CardwallConfigXml::NODE_CARDWALL}) {
return;
}
$rng_path = realpath(CARDWALL_BASE_DIR . '/../www/resources/xml_project_cardwall.rng');
$this->xml_validator->validate($xml_input->{CardwallConfigXml::NODE_CARDWALL}, $rng_path);
$this->importCardwalls($xml_input->{CardwallConfigXml::NODE_CARDWALL});
$this->event_manager->processEvent(Event::IMPORT_XML_PROJECT_CARDWALL_DONE, array('project_id' => $this->group_id, 'xml_content' => $xml_input, 'mapping' => $this->mapping));
}
示例7: allowSVNTokensForProject
private function allowSVNTokensForProject($project_to_migrate)
{
$project = $this->project_manager->getProjectFromAutocompleter($project_to_migrate);
if ($project && $this->token_manager->canAuthorizeTokens($project)) {
$this->token_manager->setProjectAuthorizesTokens($project);
$this->event_manager->processEvent(Event::SVN_AUTHORIZE_TOKENS, array('group_id' => $project->getID()));
$GLOBALS['Response']->addFeedback(Feedback::INFO, $GLOBALS['Language']->getText('svn_tokens', 'allowed_project_allow_project'));
} else {
$this->sendUpdateProjectListError();
}
}
示例8: importContent
private function importContent($project_id, $file_contents)
{
$this->logger->info("Importing project in project {$project_id}");
$this->checkFileIsValidXML($file_contents);
$xml_element = simplexml_load_string($file_contents);
$project = $this->getProject($project_id);
$this->importUgroups($project, $xml_element);
$this->logger->info("Ask to plugin to import data from XML");
$this->event_manager->processEvent(Event::IMPORT_XML_PROJECT, array('project' => $project, 'xml_content' => $xml_element));
$this->logger->info("Finish importing project in project {$project_id}");
}
示例9: updateAccess
public function updateAccess($new_value, $old_value)
{
if ($new_value === $old_value) {
return;
}
$property_name = ForgeAccess::CONFIG;
$this->config_dao->save($property_name, $new_value);
$this->event_manager->processEvent(Event::SITE_ACCESS_CHANGE, array('new_value' => $new_value, 'old_value' => $old_value));
if ($old_value === ForgeAccess::RESTRICTED || $new_value === ForgeAccess::RESTRICTED) {
$this->project_manager->disableAllowRestrictedForAll();
$this->permission_manager->disableRestrictedAccess();
}
}
示例10: importContent
private function importContent(Project $project, $xml_contents, $extraction_path)
{
$project_id = $project->getID();
$this->logger->info("Importing project in project {$project_id}");
$this->checkFileIsValidXML($xml_contents);
$xml_element = simplexml_load_string($xml_contents);
$this->importUgroups($project, $xml_element);
$svn = new SVNXMLImporter($this->logger, $this->xml_validator);
$svn->import($project, $xml_element, $extraction_path);
$this->logger->info("Ask to plugin to import data from XML");
$this->event_manager->processEvent(Event::IMPORT_XML_PROJECT, array('project' => $project, 'xml_content' => $xml_element, 'extraction_path' => $extraction_path, 'user_finder' => $this->user_finder));
$this->logger->info("Finish importing project in project {$project_id}");
}
示例11: getGroupIdFromArtifactIdForCallbackFunction
/**
* Return the group_id of an artifact_id
*
* @param Integer $artifact_id
*
* @return Integer
*/
protected function getGroupIdFromArtifactIdForCallbackFunction($artifact_id)
{
$group_id = $this->getGroupIdFromArtifactId($artifact_id);
if ($group_id === false) {
$this->eventManager->processEvent(Event::GET_ARTIFACT_REFERENCE_GROUP_ID, array('artifact_id' => $artifact_id, 'group_id' => &$group_id));
}
return $group_id;
}
示例12: 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);
}
示例13: importContent
private function importContent(Project $project, SimpleXMLElement $xml_element, $extraction_path)
{
$this->logger->info("Importing project in project " . $project->getUnixName());
$this->importUgroups($project, $xml_element);
$svn = new SVNXMLImporter($this->logger, $this->xml_validator);
$svn->import($project, $xml_element, $extraction_path);
$this->logger->info("Ask to plugin to import data from XML");
$this->event_manager->processEvent(Event::IMPORT_XML_PROJECT, array('logger' => $this->logger, 'project' => $project, 'xml_content' => $xml_element, 'extraction_path' => $extraction_path, 'user_finder' => $this->user_finder));
$this->logger->info("Finish importing project in project " . $project->getUnixName());
}
示例14: authenticateFromDatabase
private function authenticateFromDatabase(PFUser $user, $password)
{
$is_auth_valid = false;
if ($this->verifyPassword($user, $password)) {
$user->setPassword($password);
$this->checkPasswordStorageConformity($user);
$is_auth_valid = true;
$this->event_manager->processEvent(Event::SESSION_AFTER_LOGIN, array('user' => $user, 'allow_codendi_login' => &$is_auth_valid));
}
return $is_auth_valid;
}
示例15: testAttachListener4
/**
* attach a callable directly
*
* @covers Phossa\Event\EventManager::attachListener
*/
public function testAttachListener4()
{
// attach a callable
$this->object->attachListener(function (Event $evt) {
$evt->setProperty('xxx', 'bingo');
return 10;
}, 'bingoEvent');
$evt = new Event('bingoEvent');
$this->object->processEvent($evt);
$this->assertArrayHasKey('xxx', $evt->getProperties());
}