public final function __construct(Http $http = null) { // 绑定当前的默认的上下文环境实例 if (!isset(self::$web)) { self::$web = $this; } $this->app = App::getApp(); if (!$this->app->isInit()) { $this->app->init(); } $this->ob = OutputBuffer::getInstance()->start('webStart'); $this->mime = $this->app->getMime(); $this->http = $http ?? Http::current(); $this->component = (new Component())->setDirs(['appView' => [$this->app->appNs('View'), 100, Component::VIEW], 'appComponent' => [$this->app->appNs('Component'), 100], 'kephpComponent' => [$this->app->kephp('Ke/Component'), 1000]]); $this->prepare(); $this->onConstruct(); }