소스 검색

[RequestHandler] added getPort() and setMethod() to Request

Fabien Potencier 15 년 전
부모
커밋
038f7d7bb4
1개의 변경된 파일11개의 추가작업 그리고 0개의 파일을 삭제
  1. 11 0
      src/Symfony/Components/RequestHandler/Request.php

+ 11 - 0
src/Symfony/Components/RequestHandler/Request.php

@@ -238,6 +238,11 @@ class Request
     return ($this->server->get('HTTPS') == 'on') ? 'https' : 'http';
   }
 
+  public function getPort()
+  {
+    return $this->server->get('SERVER_PORT');
+  }
+
   public function getHttpHost()
   {
     $host = $this->headers->get('HOST');
@@ -300,6 +305,12 @@ class Request
     }
   }
 
+  public function setMethod($method)
+  {
+    $this->method = null;
+    $this->server->set('REQUEST_METHOD', 'GET');
+  }
+
   /**
    * Gets the request method.
    *