private function test() { echo $encoding = \HuiLib\Helper\Param::server('fdasfdsa', \HuiLib\Helper\Param::TYPE_BOOL); var_dump($encoding); echo $encoding = \HuiLib\Helper\Param::server('fdasfdsa', \HuiLib\Helper\Param::TYPE_STRING); var_dump($encoding); }
public function init() { $this->scriptUrl = Param::getScriptUrl(); $this->httpHost = Param::server('HTTP_HOST', Param::TYPE_STRING); //规范访问重写请求Url $this->formatRequestURI(); //设置路由资源定位符,并初始化路由信息 $this->routeUri = $this->httpHost . $this->scriptUrl; $this->initRouteInfo(); }
/** * 开启输出控制 */ public function obstart() { $encoding = Param::server('HTTP_ACCEPT_ENCODING', Param::TYPE_STRING); $accept = in_array('gzip', explode(',', $encoding)); if ($this->gzipEnable && function_exists('ob_gzhandler') && $accept) { ob_start('ob_gzhandler'); } else { $this->gzipEnable = FALSE; ob_start(); } }