本文整理汇总了PHP中Scalr_UI_Controller::handleRequest方法的典型用法代码示例。如果您正苦于以下问题:PHP Scalr_UI_Controller::handleRequest方法的具体用法?PHP Scalr_UI_Controller::handleRequest怎么用?PHP Scalr_UI_Controller::handleRequest使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Scalr_UI_Controller
的用法示例。
在下文中一共展示了Scalr_UI_Controller::handleRequest方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: microtime
$possibleCsrf = false;
}
if ($possibleCsrf) {
//Scalr_Session::destroy();
$response->failure('Your session became invalid. <a href="/guest/logout">Click here to login again</a>', true);
$response->sendResponse();
} else {
$initTime = microtime(true);
$response->setHeader("X-Scalr-PrependTime", $prependTime - $startTime);
$response->setHeader("X-Scalr-InitTime", $initTime - $prependTime);
$response->setHeader("X-Scalr-InitTime1", $time1 - $prependTime);
$response->setHeader("X-Scalr-InitTime2", $time2 - $prependTime);
$response->setHeader("X-Scalr-InitTime3", $time3 - $prependTime);
$response->setHeader("X-Scalr-InitTime4", $time4 - $prependTime);
$response->setHeader("X-Scalr-InitTime5", $time5 - $prependTime);
Scalr_UI_Controller::handleRequest(explode('/', $path));
Scalr_UI_Response::getInstance()->sendResponse();
}
} else {
Scalr_UI_Response::getInstance()->setHeader("X-Scalr-Forbiden", "3: {$_SERVER['HTTP_HOST']}");
Scalr_UI_Response::getInstance()->setHttpResponseCode(403);
Scalr_UI_Response::getInstance()->sendResponse();
}
} catch (ADODB_Exception $e) {
$logMysqlExcepton($e);
} catch (\Scalr\Exception\MysqlConnectionException $e) {
$logMysqlExcepton($e);
} catch (\Scalr\Exception\FileNotFoundException $e) {
Scalr_UI_Response::getInstance()->failure(sprintf("File '%s' not found", $e->getPath()));
Scalr_UI_Response::getInstance()->setHttpResponseCode(404);
Scalr_UI_Response::getInstance()->sendResponse();
示例2: trim
$path = trim(str_replace("?{$_SERVER['QUERY_STRING']}", "", $_SERVER['REQUEST_URI']), '/');
define('SCALR_NOT_CHECK_SESSION', 1);
try {
$t = microtime(true);
require "src/prepend.inc.php";
$pTime = microtime(true) - $t;
@header("X-Scalr-PTime: {$pTime}");
$session = Scalr_Session::getInstance();
try {
$request = Scalr_UI_Request::initializeInstance(Scalr_UI_Request::REQUEST_TYPE_UI, $session->getUserId(), $session->getEnvironmentId());
} catch (Exception $e) {
if ($path == 'guest/logout') {
// hack
Scalr_Session::destroy();
Scalr_UI_Response::getInstance()->setRedirect('/');
Scalr_UI_Response::getInstance()->sendResponse();
exit;
}
$message = $e->getMessage() . ' <a href="/guest/logout">Click here to login as another user</a>';
throw new Exception($message);
}
if ($session->isAuthenticated()) {
$session->setEnvironmentId($request->getEnvironment()->id);
}
//@session_write_close();
Scalr_UI_Controller::handleRequest(explode('/', $path), $_REQUEST);
$totalTime = microtime(true) - $t;
} catch (Exception $e) {
Scalr_UI_Response::getInstance()->failure($e->getMessage());
Scalr_UI_Response::getInstance()->sendResponse();
}