本文整理汇总了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;
}
示例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();
}
}
示例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();