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


PHP WCF::getApplicationObject方法代码示例

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


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

示例1: handleDefaultController

 /**
  * Checks page access for possible mandatory redirects.
  * 
  * @param	string		$application
  * @param	array		$routeData
  */
 protected function handleDefaultController($application, array &$routeData)
 {
     if (!RouteHandler::getInstance()->isDefaultController()) {
         return;
     }
     $landingPage = PageMenu::getInstance()->getLandingPage();
     if ($landingPage === null) {
         return;
     }
     if (empty($routeData['controller'])) {
         $routeData['isImplicitController'] = true;
     }
     // resolve implicit application abbreviation for landing page controller
     $landingPageApplication = $landingPage->getApplication();
     $primaryApplication = ApplicationHandler::getInstance()->getPrimaryApplication();
     $primaryApplicationAbbr = ApplicationHandler::getInstance()->getAbbreviation($primaryApplication->packageID);
     if ($landingPageApplication == 'wcf') {
         $landingPageApplication = $primaryApplicationAbbr;
     }
     // check if currently invoked application matches the landing page
     if ($landingPageApplication == $application) {
         $routeData['controller'] = $landingPage->getController();
         if (!URL_LEGACY_MODE) {
             $routeData['controller'] = self::getTokenizedController($routeData['controller']);
         }
         // use alias if defined to prevent incorrect recognition
         $alias = $this->getAliasByController($routeData['controller']);
         if ($alias !== null) {
             $routeData['controller'] = $alias;
         }
         return;
     }
     // redirect if this is the primary application
     if ($application === $primaryApplicationAbbr) {
         HeaderUtil::redirect($landingPage->getLink());
         exit;
     }
     // set default controller
     $applicationObj = WCF::getApplicationObject(ApplicationHandler::getInstance()->getApplication($application));
     $routeData['controller'] = preg_replace('~^.*?\\\\([^\\\\]+)(?:Action|Form|Page)$~', '\\1', $applicationObj->getPrimaryController());
     if (!URL_LEGACY_MODE) {
         $routeData['controller'] = self::getTokenizedController($routeData['controller']);
     }
 }
开发者ID:jacboy,项目名称:WCF,代码行数:50,代码来源:RequestHandler.class.php

示例2: loadDefaultControllers

 /**
  * Loads the default controllers for each active application.
  */
 protected function loadDefaultControllers()
 {
     if ($this->defaultControllers === null) {
         $this->defaultControllers = array();
         foreach (ApplicationHandler::getInstance()->getApplications() as $application) {
             $app = WCF::getApplicationObject($application);
             if (!$app) {
                 continue;
             }
             $controller = $app->getPrimaryController();
             if (!$controller) {
                 continue;
             }
             $controller = explode('\\', $controller);
             $controllerName = preg_replace('~(Action|Form|Page)$~', '', array_pop($controller));
             $this->defaultControllers[$controller[0]] = $controllerName;
         }
     }
 }
开发者ID:nick-strohm,项目名称:WCF,代码行数:22,代码来源:RouteHandler.class.php


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