protocol){ $this->protocol = Yii::$app->request->isSecureConnection ? 'https' : 'http'; } if(!$this->host){ $this->host = explode(':', $_SERVER['HTTP_HOST'])[0]; } $this->_urlPrefix = $this->protocol . '://' . $this->host . ($this->port ? (($this->protocol == 'https' && $this->port == 443) || ($this->protocol == 'http' && $this->port == 80) ? '' : (':' . $this->port)) : ''); } /** * getApp(Mixed $id) * 获取app实例 * ---------------------- * @param Mixed $id 活动编号 * ------------------------ * @return Object * @author Verdient。 */ public function getApp($id = null){ return new App($this->key, $this->_urlPrefix, $id); } }