本文整理匯總了PHP中PluginEngine::routeRequest方法的典型用法代碼示例。如果您正苦於以下問題:PHP PluginEngine::routeRequest方法的具體用法?PHP PluginEngine::routeRequest怎麽用?PHP PluginEngine::routeRequest使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PluginEngine
的用法示例。
在下文中一共展示了PluginEngine::routeRequest方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: page_open
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*/
require '../lib/bootstrap.php';
# set base url for URLHelper class
URLHelper::setBaseUrl($CANONICAL_RELATIVE_PATH_STUDIP);
# initialize Stud.IP-Session
page_open(array('sess' => 'Seminar_Session', 'auth' => 'Seminar_Default_Auth', 'perm' => 'Seminar_Perm', 'user' => 'Seminar_User'));
try {
require_once 'lib/seminar_open.php';
# get plugin class from request
$dispatch_to = isset($_SERVER['PATH_INFO']) ? $_SERVER['PATH_INFO'] : '';
list($plugin_class, $unconsumed) = PluginEngine::routeRequest($dispatch_to);
# retrieve corresponding plugin info
$plugin_manager = PluginManager::getInstance();
$plugin_info = $plugin_manager->getPluginInfo($plugin_class);
# create an instance of the queried plugin
$plugin = PluginEngine::getPlugin($plugin_class);
# user is not permitted, show login screen
if (is_null($plugin)) {
# TODO (mlunzena) should not getPlugin throw this exception?
throw new AccessDeniedException(_('Sie besitzen keine Rechte zum Aufruf dieses Plugins.'));
}
// set default page title
PageLayout::setTitle($plugin->getPluginName());
if (is_callable(array($plugin, 'initialize'))) {
$plugin->initialize();
}