Ver código fonte

Update cli mode

Jinhui Zhu 7 anos atrás
pai
commit
b7046e15a2
2 arquivos alterados com 2 adições e 2 exclusões
  1. 1 1
      Qii/Base/Request.php
  2. 1 1
      _cli.php

+ 1 - 1
Qii/Base/Request.php

@@ -44,7 +44,7 @@ abstract class Request
         }
         $rewriteRule = \Qii::getInstance()->appConfigure(\Qii\Config\Consts::APP_SITE_METHOD);
         $this->url = new \Qii\Request\Url($rewriteRule);
-        $this->host = $_SERVER['HTTP_HOST'];
+        $this->host = IS_CLI ? '' : $_SERVER['HTTP_HOST'];
         $params = (array)$this->url->getParams();
         if(count($params) > 0) $this->params = array_merge($this->params, $params);
         //处理url中的数据

+ 1 - 1
_cli.php

@@ -292,7 +292,7 @@ class cmd
      */
     public function stdout($string)
     {
-        $string = iconv('utf-8', 'gbk', $string);
+        if(OS == 'WIN') $string = iconv('utf-8', 'gbk', $string);
         fwrite(\STDOUT, $string);
     }
 }