<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                # Context 上下文共享 middleware,controller,model,task,在一個消息流程中共享同一個上下文Context。 其中middleware,controller,model可以修改Context,而task只能讀取不能修改。 例如MonitorMiddleware ```php public function after_handle($path) { $this->context['path'] = $path; $this->context['execution_time'] = (microtime(true) - $this->start_run_time) * 1000; if (self::$efficiency_monitor_enable) { $this->log('Monitor'); } } ``` 這里將context附加了path和execution_time,在after_handle流程前所有對context的操作都會影響到這里的context。 ## Controller,Model,Task 通過getContext獲取當前的上下文。 ## RunStack Context中包含RunStack字段,這個字段將記錄消息流程中所執行的Middleware,Controller,Model,Task的方法。 例如: ``` Array ( [RunStack] => Array ( [0] => Server\Middlewares\MonitorMiddleware::before_handle [1] => Server\Middlewares\NormalHttpMiddleware::before_handle [2] => Server\Controllers\TestController::setRequestResponse [3] => Server\Controllers\TestController::http_testContext [4] => Server\Models\TestModel::contextTest [5] => Server\Tasks\TestTask::contextTest [6] => Server\CoreBase\TaskProxy::startTask [7] => Server\Models\TestModel::destroy [8] => Server\Controllers\TestController::destroy [9] => Server\Middlewares\NormalHttpMiddleware::after_handle [10] => Server\Middlewares\MonitorMiddleware::after_handle ) [request_id] => 15081258371921825039 [controller_name] => TestController [method_name] => TestController:http_testContext [test] => 1 [path] => /TestController/testContext [execution_time] => 4.1890144348145 ) ``` 通過這個可以精確判斷發生異常和錯誤的位置,也可以了解到SD框架的工作流程。 你可以在AppServer的__construct方法中設置$this->setDebugMode()來開啟這個打印。 ``` public function __construct() { $this->setLoader(new Loader()); $this->setDebugMode(); parent::__construct(); } ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看