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


PHP Scalr_UI_Controller::handleRequest方法代码示例

本文整理汇总了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();
开发者ID:sacredwebsite,项目名称:scalr,代码行数:31,代码来源:ui.php

示例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();
}
开发者ID:rakesh-mohanta,项目名称:scalr,代码行数:31,代码来源:ui.php


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