當前位置: 首頁>>代碼示例>>PHP>>正文


PHP PluginEngine::routeRequest方法代碼示例

本文整理匯總了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();
    }
開發者ID:ratbird,項目名稱:hope,代碼行數:31,代碼來源:plugins.php


注:本文中的PluginEngine::routeRequest方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。