예제 #1
0
 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);
 }
예제 #2
0
파일: Http.php 프로젝트: ZhuJingfa/HuiLib
 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();
 }
예제 #3
0
파일: Output.php 프로젝트: ZhuJingfa/HuiLib
 /**
  * 开启输出控制
  */
 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();
     }
 }