本文整理汇总了PHP中TBGContext::setLoadedAt方法的典型用法代码示例。如果您正苦于以下问题:PHP TBGContext::setLoadedAt方法的具体用法?PHP TBGContext::setLoadedAt怎么用?PHP TBGContext::setLoadedAt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TBGContext
的用法示例。
在下文中一共展示了TBGContext::setLoadedAt方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: go
/**
* Launches the MVC framework
*/
public static function go()
{
TBGLogging::log('Dispatching');
try {
if (($route = self::getRouting()->getRouteFromUrl(self::getRequest()->getParameter('url', null, false))) || self::isInstallmode()) {
if (self::isUpgrademode()) {
$route = array('module' => 'installation', 'action' => 'upgrade');
} elseif (self::isInstallmode()) {
$route = array('module' => 'installation', 'action' => 'installIntro');
}
if (self::$_redirect_login) {
TBGLogging::log('An error occurred setting up the user object, redirecting to login', 'main', TBGLogging::LEVEL_NOTICE);
self::getResponse()->headerRedirect(self::getRouting()->generate('login_redirect'), 403);
}
if (is_dir(THEBUGGENIE_MODULES_PATH . $route['module'])) {
if (!file_exists(THEBUGGENIE_MODULES_PATH . $route['module'] . DS . 'classes' . DS . 'actions.class.php')) {
throw new TBGActionNotFoundException('The ' . $route['module'] . ' module is missing the classes/actions.class.php file, containing all the module actions');
}
if (!class_exists($route['module'] . 'Actions') && !class_exists($route['module'] . 'ActionComponents')) {
self::addClasspath(THEBUGGENIE_MODULES_PATH . $route['module'] . DS . 'classes' . DS);
}
if (self::performAction($route['module'], $route['action'])) {
if (B2DB::isInitialized()) {
B2DB::closeDBLink();
}
return true;
}
} else {
throw new Exception('Cannot load the ' . $route['module'] . ' module');
return;
}
} else {
require THEBUGGENIE_MODULES_PATH . 'main' . DS . 'classes' . DS . 'actions.class.php';
self::performAction('main', 'notFound');
}
} catch (TBGTemplateNotFoundException $e) {
B2DB::closeDBLink();
TBGContext::setLoadedAt();
header("HTTP/1.0 404 Not Found", true, 404);
tbg_exception($e->getMessage(), $e);
} catch (TBGActionNotFoundException $e) {
B2DB::closeDBLink();
TBGContext::setLoadedAt();
header("HTTP/1.0 404 Not Found", true, 404);
tbg_exception('Module action "' . $route['action'] . '" does not exist for module "' . $route['module'] . '"', $e);
} catch (TBGCSRFFailureException $e) {
B2DB::closeDBLink();
TBGContext::setLoadedAt();
self::$_response->setHttpStatus(301);
$message = $e->getMessage();
if (self::getRequest()->getRequestedFormat() == 'json') {
self::$_response->setContentType('application/json');
$message = json_encode(array('message' => $message));
}
self::$_response->renderHeaders();
echo $message;
} catch (Exception $e) {
B2DB::closeDBLink();
TBGContext::setLoadedAt();
header("HTTP/1.0 404 Not Found", true, 404);
tbg_exception('An error occured', $e);
}
}