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


PHP NotificationManager::setEventManager方法代码示例

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


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

示例1: EventManager

// --------------------------------------------------
$eventManager = new EventManager();
Settings::setProtected('eventManager', $eventManager);
// Initialize transcript controller
// --------------------------------------------------
Transcript::setEventManager($eventManager);
Transcript::register('load', array('TranscriptController', 'load'));
Transcript::register('save', array('TranscriptController', 'save'));
Transcript::register('diff', array('TranscriptController', 'diff'));
// Initialize workflow controller
// --------------------------------------------------
Workflow::register('callback', array('WorkflowController', 'parse'));
// Initialize notifications controller
// --------------------------------------------------
$notifications = Settings::getProtected('notifications');
$notificationsList = array();
foreach ($notifications as $key => $value) {
    // Get an array of just the keys
    array_push($notificationsList, $key);
}
$notify = new NotificationManager();
$notify->setEventManager($eventManager);
$notify->registerNotifications($notificationsList, array('NotificationController', 'send'));
Settings::setProtected('notify', $notify);
// Parse the routes
// --------------------------------------------------
// The \.?([^/]*)?/? at the end allows us to add .json, etc. for other formats
// Create the routes we want to use
$routes = array('#^/?$#' => 'SystemPageController::index', '#^/login/?$#' => 'SystemPageController::login', '#^/logout/?$#' => 'SystemPageController::logout', '#^/signup(\\.[^/]+)?/?$#' => 'SystemPageController::signup', '#^/signup/activate/(.*)(\\.[^/]+)?/?$#' => 'SystemPageController::activate', '#^/messages/?$#' => 'SystemPageController::message', '#^/install/?$#' => 'SystemPageController::install', '#^/test/(.*)/?$#' => 'SystemPageController::test', '#^/(users)/([^/]+)/projects/([^/]+)/items/get(\\.[^/]+)?/?#' => 'ItemPageController::getNewItem', '#^/(users)/([^/]+)/projects/([^/]+)/items/([^/.]+)/transcript(\\.[^/]+)?/?#' => 'ItemPageController::transcript', '#^/(users)/([^/]+)/projects/([^/]+)/items/([^/.]+)/delete(\\.[^/]+)?/?#' => 'ItemPageController::deleteItem', '#^/(users)/([^/]+)/projects/([^/]+)/items/([^/.]+)/(proof|review)(\\.[^/]+)?/?#' => 'ItemPageController::itemProof', '#^/(users)/([^/]+)/projects/([^/]+)/items/([^/.]+)/(proof|review|edit)(\\.[^/]+)?/?#' => 'ItemPageController::itemProof', '#^/(users)/([^/]+)/projects/([^/]+)/items/([^/.]+)(\\.[^/]+)?/?#' => 'ItemPageController::item', '#^/(users)/([^/]+)/projects/([^/]+)/items(\\.[^/]+)?/?#' => 'ItemPageController::items', '#^/(users)/([^/]+)/projects/([^/]+)/transcript/split(\\.[^/]+)?/?#' => 'ProjectPageController::splitTranscript', '#^/(users)/([^/]+)/projects/([^/]+)/transcript(\\.[^/]+)?/?#' => 'ProjectPageController::transcript', '#^/(users)/([^/]+)/projects/([^/]+)/membership/leave(\\.[^/]+)?/?#' => 'ProjectPageController::membershipLeave', '#^/(users)/([^/]+)/projects/([^/]+)/membership(\\.[^/]+)?/?#' => 'ProjectPageController::membership', '#^/(users)/([^/]+)/projects/([^/]+)/admin(\\.[^/]+)?/?#' => 'ProjectPageController::admin', '#^/(users)/([^/]+)/projects/([^/]+)/upload(\\.[^/]+)?/?#' => 'ProjectPageController::upload', '#^/(users)/([^/]+)/projects/([^/]+)/import(\\.[^/]+)?/?#' => 'ProjectPageController::import', '#^/(users)/([^/]+)/projects/new-project(\\.[^/]+)?/?#' => 'ProjectPageController::newProject', '#^/(users)/([^/]+)/projects/([^/.]+)(\\.[^/]+)?/?#' => 'ProjectPageController::projectPage', '#^/(users)/([^/]+)/projects(\\.[^/]+)?/?#' => 'ProjectPageController::projects', '#^/users/([^/]+)/dashboard(\\.[^/]+)?/?#' => 'UserPageController::userDashboard', '#^/users/([^/]+)/settings(\\.[^/]+)?/?#' => 'UserPageController::userSettings', '#^/users/([^/.]+)(\\.[^/]+)?/?#' => 'UserPageController::userPage', '#^/users(\\.[^/]+)?/?#' => 'UserPageController::users', '#^/projects/([^/]+)/items/get(\\.[^/]+)?/?#' => 'ItemPageController::getNewItem', '#^/projects/([^/]+)/items/([^/.]+)/transcript(\\.[^/]+)?/?#' => 'ItemPageController::transcript', '#^/projects/([^/]+)/items/([^/.]+)/delete(\\.[^/]+)?/?#' => 'ItemPageController::deleteItem', '#^/projects/([^/]+)/items/([^/.]+)/(proof|review)/(\\.[^/]+)/?#' => 'ItemPageController::itemProof', '#^/projects/([^/]+)/items/([^/.]+)/(proof|review|edit)(\\.[^/]+)?/?#' => 'ItemPageController::itemProof', '#^/projects/([^/]+)/items/([^/.]+)(\\.[^/]+)?/?#' => 'ItemPageController::item', '#^/projects/([^/]+)/items(\\.[^/]+)?/?#' => 'ItemPageController::items', '#^/projects/([^/]+)/transcript/split(\\.[^/]+)?/?#' => 'ProjectPageController::splitTranscript', '#^/projects/([^/]+)/transcript(\\.[^/]+)?/?#' => 'ProjectPageController::transcript', '#^/projects/([^/]+)/membership/leave(\\.[^/]+)?/?#' => 'ProjectPageController::membershipLeave', '#^/projects/([^/]+)/membership(\\.[^/]+)?/?#' => 'ProjectPageController::membership', '#^/projects/([^/]+)/admin(\\.[^/]+)?/?#' => 'ProjectPageController::admin', '#^/projects/([^/]+)/upload(\\.[^/]+)?/?#' => 'ProjectPageController::upload', '#^/projects/([^/]+)/import(\\.[^/]+)?/?#' => 'ProjectPageController::import', '#^/projects/new-project(\\.[^/]+)?/?#' => 'ProjectPageController::newProject', '#^/projects/([^/.]+)(\\.[^/]+)?/?#' => 'ProjectPageController::projectPage', '#^/projects(\\.[^/]+)?/?#' => 'ProjectPageController::projects', '#^/admin(\\.[^/]+)?/?$#' => 'AdminPageController::admin');
$router = new Router('SystemPageController::fileNotFound');
$router->route($routes);
开发者ID:hmmbug,项目名称:unbindery,代码行数:31,代码来源:index.php


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