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


PHP Loader::includeApplicationClass方法代码示例

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


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

示例1: loadController

 /**
  * Creates an instance of the Controller specified in the Context,
  * and verifies that the requested action exists, returning
  * the created instance if true, or false if not
  * @param Context $context
  * @return Controller
  */
 protected final function loadController(Context $context)
 {
     $page_name = Loader::includeApplicationClass($context);
     #Search the requested action, only return the page object
     #if the action exists
     if ($page_name) {
         $page = new $page_name($context);
         $action_method = array(&$page, $context->getAction());
         return is_callable($action_method) ? $page : false;
     }
     return false;
 }
开发者ID:RNKushwaha022,项目名称:orange-php,代码行数:19,代码来源:router.class.php

示例2: loadPlugins

 private function loadPlugins()
 {
     foreach (AppConfig::$plugins as $plugin => $config) {
         $parts = explode('/', $plugin);
         $context = new Context('plugin', $parts[0], $parts[1], array(), false);
         $plugin_name = Loader::includeApplicationClass($context);
         if ($plugin_name) {
             $plugin = new $plugin_name($context, $config);
             $this->plugins[$plugin->getName()] = $plugin;
         }
     }
     $this->list = new PluginList($this->plugins);
     foreach ($this->plugins as $plugin) {
         $plugin->initialize();
     }
 }
开发者ID:RNKushwaha022,项目名称:orange-php,代码行数:16,代码来源:pluginmanager.class.php

示例3: array_walk_recursive

    array_walk_recursive($gpc, 'undo_magic_quotes');
}
$plugin_manager = PluginManager::getInstance();
$url_mapper = new UrlMapper();
$context = $url_mapper->map($_SERVER['REQUEST_URI']);
if (!$context) {
    header("HTTP/1.1 400 Bad Request");
    @(include PHAXSI_ERROR_400);
    exit;
}
if (AppConfig::$language_redirect && !Lang::wasSet()) {
    $lang = Lang::autoDetect();
    RedirectHelper::to(UrlHelper::current($lang));
}
if (AppConfig::CUSTOM_ROUTER) {
    $router_name = Loader::includeApplicationClass(new Context('router', AppConfig::CUSTOM_ROUTER));
    if ($router_name) {
        $router = new $router_name();
    } else {
        trigger_error('Custom router "' . AppConfig::CUSTOM_ROUTER . '" was not found', E_USER_ERROR);
    }
} else {
    $router = new Router();
}
$controller = $router->getController($context);
if (!$controller) {
    header("HTTP/1.1 404 Not Found");
    @(include PHAXSI_ERROR_404);
    exit;
}
$context = $controller->_getContext();
开发者ID:RNKushwaha022,项目名称:orange-php,代码行数:31,代码来源:main.php


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