コード例 #1
0
ファイル: ParamTest.php プロジェクト: ZhuJingfa/HuiLib
 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();
     }
 }