<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>

                ### 常駐內存沒有上下文隔離 常駐內存下采用單例的控制器,不會因為每次請求都new一次控制器。 BaseController.php ```php class BaseController { protected $num = 0; } ``` Controller.php ```php class Controller extends BaseController { public function index(){ $this->num++; return "index:".$this->num; } public function test(){ $this->num++; return "test:".$this->num; } } ``` Server.php ```php include './BaseController.php'; include './Controller.php'; class Server { private $server; private $controller; public function __construct() { $this->controller = new Controller(); $this->server = new Swoole\Http\Server("127.0.0.1", 9501); $this->server->on('request', function ($request, $response){ $c = $request->get['c']??'index'; $res = call_user_func([$this->controller,$c]); $response->end($res); }); $this->server->start(); } } new Server(); ``` 分別請求一下: * http://127.0.0.1:9501/ * http://127.0.0.1:9501?c=test
                  <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>

                              哎呀哎呀视频在线观看