Imbo\Http\Request\Request::getRawUri PHP Method

getRawUri() public method

Get the URI without the Symfony normalization applied to the query string, un-encoded
public getRawUri ( ) : string
return string
    public function getRawUri()
    {
        $query = $this->server->get('QUERY_STRING');
        if (!empty($query)) {
            $query = '?' . urldecode($query);
        }
        return $this->getSchemeAndHttpHost() . $this->getBaseUrl() . $this->getPathInfo() . $query;
    }

Usage Example

示例#1
0
文件: RequestTest.php 项目: imbo/imbo
 /**
  * @dataProvider getQueryStrings
  */
 public function testGetRawUriDecodesUri($queryString, $expectedQueryString)
 {
     $request = new Request([], [], [], [], [], ['SERVER_NAME' => 'imbo', 'SERVER_PORT' => 80, 'QUERY_STRING' => $queryString]);
     $uri = $request->getRawUri();
     $this->assertSame($expectedQueryString, substr($uri, strpos($uri, '?') + 1));
 }
All Usage Examples Of Imbo\Http\Request\Request::getRawUri