프로퍼티 | 타입 | 설명 | |
---|---|---|---|
$arguments | array | ||
$attributes | array | PSR-7 | |
$baseUri | |||
$inputStreamUri | string | URI for the "input" stream wrapper which can be modified for testing purposes | |
$method | string | ||
$server | array | Data similar to that which is typically provided by $_SERVER | |
$uri |
메소드 | 설명 | |
---|---|---|
__clone ( ) | Creates a deep clone | |
__construct ( array $get, array $post, array $files, array $server ) | Constructs a new Request object based on the given environment data. | |
__toString ( ) : string | Cast the request to a string: return the content part of this response | |
create ( |
Creates a new Request object from the given data. | |
createActionRequest ( ) : |
Creates a new Action Request request as a sub request to this HTTP request. | |
createFromEnvironment ( ) : |
Considers the environment information found in PHP's superglobals and Flow's environment configuration and creates a new instance of this Request class matching that data. | |
getAcceptedMediaTypes ( ) : array | Returns an list of IANA media types defined in the Accept header. | |
getArgument ( string $name ) : mixed | Returns the value of the specified GET / POST / PUT argument. | |
getArguments ( ) : array | Returns the unified arguments of this request. | |
getAttribute ( string $name, mixed $default = null ) : mixed | PSR-7 | |
getAttributes ( ) : mixed[] | PSR-7 | |
getBaseUri ( ) : |
Returns the detected base URI | |
getClientIpAddress ( ) : string | Returns the best guess of the client's IP address. | |
getContent ( boolean $asResource = false ) : string | resource | Returns the content of the request body | |
getMethod ( ) : string | Returns the request method | |
getNegotiatedMediaType ( array $supportedMediaTypes, boolean $trim = true ) : string | Returns the best fitting IANA media type after applying the content negotiation rules on a possible Accept header. | |
getPort ( ) : integer | Returns the port used for this request | |
getRelativePath ( ) : string | Returns the request's path relative to the $baseUri | |
getRequestLine ( ) : string | Return the Request-Line of this Request Message, consisting of the method, the uri and the HTTP version Would be, for example, "GET /foo?bar=baz HTTP/1.1" Note that the URI part is, at the moment, only possible in the form "abs_path" since the actual requestUri of the Request cannot be determined during the creation of the Request. | |
getScriptRequestPath ( ) : string | Returns the relative path (ie. relative to the web root) to the script as it was accessed through the web server. | |
getScriptRequestPathAndFilename ( ) : string | Returns the relative path (ie. relative to the web root) and name of the script as it was accessed through the web server. | |
getServerParams ( ) : array | PSR-7 | |
getStartLine ( ) : string | Returns the first line of this Request Message, which is the Request-Line in this case | |
getUri ( ) : |
Returns the request URI | |
hasArgument ( string $name ) : boolean | Checks if an argument of the given name exists in this request. | |
isMethodSafe ( ) : boolean | Tells if the request method is "safe", that is, it is expected to not take any other action than retrieval. This should the case with "GET" and "HEAD" requests. | |
isSecure ( ) : boolean | Indicates if this request has been received through a secure channel. | |
mediaRangeMatches ( string $mediaRange, string $mediaType ) : boolean | Checks if the given media range and the media type match. | |
parseContentNegotiationQualityValues ( string $rawValues ) : array | Parses a RFC 2616 content negotiation header field by evaluating the Quality Values and splitting the options into an array list, ordered by user preference. | |
parseMediaType ( string $rawMediaType ) : array | Parses a RFC 2616 Media Type and returns its parts in an associative array. | |
renderHeaders ( ) : string | Renders the HTTP headers - including the status header - of this request | |
setBaseUri ( |
||
setContent ( string | resource $content ) : void | Explicitly sets the content of the request body | |
setMethod ( string $method ) : void | Sets the request method | |
trimMediaType ( string $rawMediaType ) : string | Strips off any parameters from the given media type and returns just the type and subtype in the format "type/subtype". | |
withAttribute ( string $name, mixed $value ) : self | PSR-7 | |
withoutAttribute ( string $name ) : self | PSR-7 |
메소드 | 설명 | |
---|---|---|
buildUnifiedArguments ( array $getArguments, array $postArguments, array $uploadArguments ) : array | Takes the raw GET & POST arguments and maps them into the request object. | |
calculateFieldPaths ( array $structure, string $firstLevelFieldName = null ) : array | Returns and array of all possibles "field paths" for the given array. | |
detectBaseUri ( ) : void | Tries to detect the base URI of request. | |
setAttribute ( string $name, mixed $value ) | ||
unsetAttribute ( string $name ) | ||
untangleFilesArray ( array $convolutedFiles ) : array | Transforms the convoluted _FILES superglobal into a manageable form. |
public __construct ( array $get, array $post, array $files, array $server ) | ||
$get | array | Data similar to that which is typically provided by $_GET |
$post | array | Data similar to that which is typically provided by $_POST |
$files | array | Data similar to that which is typically provided by $_FILES |
$server | array | Data similar to that which is typically provided by $_SERVER |
public __toString ( ) : string | ||
리턴 | string | The same as getContent() |
public createActionRequest ( ) : |
||
리턴 |
public static createFromEnvironment ( ) : |
||
리턴 |
protected detectBaseUri ( ) : void | ||
리턴 | void |
public getAcceptedMediaTypes ( ) : array | ||
리턴 | array | A list of media types and sub types |
public getArgument ( string $name ) : mixed | ||
$name | string | Name of the argument |
리턴 | mixed | Value of the specified argument or NULL if it does not exist |
public getArguments ( ) : array | ||
리턴 | array |
public getAttributes ( ) : mixed[] | ||
리턴 | mixed[] | Attributes derived from the request. |
public getClientIpAddress ( ) : string | ||
리턴 | string | The client's IP address |
public getContent ( boolean $asResource = false ) : string | resource | ||
$asResource | boolean | If set, the content is returned as a resource pointing to PHP's input stream |
리턴 | string | resource |
public getNegotiatedMediaType ( array $supportedMediaTypes, boolean $trim = true ) : string | ||
$supportedMediaTypes | array | A list of media types which are supported by the application / controller |
$trim | boolean | If TRUE, only the type/subtype of the media type is returned. If FALSE, the full original media type string is returned. |
리턴 | string | The media type and sub type which matched, NULL if none matched |
public getRelativePath ( ) : string | ||
리턴 | string |
public getRequestLine ( ) : string | ||
리턴 | string |
public getScriptRequestPath ( ) : string | ||
리턴 | string | Relative path to the PHP script as accessed through the web |
public getScriptRequestPathAndFilename ( ) : string | ||
리턴 | string | Relative path and name of the PHP script as accessed through the web |
public getServerParams ( ) : array | ||
리턴 | array |
public getStartLine ( ) : string | ||
리턴 | string | The Request-Line of this Request |
public hasArgument ( string $name ) : boolean | ||
$name | string | Name of the argument |
리턴 | boolean |
public isMethodSafe ( ) : boolean | ||
리턴 | boolean |
public static mediaRangeMatches ( string $mediaRange, string $mediaType ) : boolean | ||
$mediaRange | string | The media range, for example "text/*" |
$mediaType | string | The media type to match against, for example "text/html" |
리턴 | boolean | TRUE if both match, FALSE if they don't match or either of them is invalid |
public static parseContentNegotiationQualityValues ( string $rawValues ) : array | ||
$rawValues | string | The raw Accept* Header field value |
리턴 | array | The parsed list of field values, ordered by user preference |
public static parseMediaType ( string $rawMediaType ) : array | ||
$rawMediaType | string | The raw media type, for example "application/json; charset=UTF-8" |
리턴 | array | An associative array with parsed information |
public renderHeaders ( ) : string | ||
리턴 | string | The HTTP headers, one per line, separated by \r\n as required by RFC 2616 sec 5 |
protected setAttribute ( string $name, mixed $value ) | ||
$name | string | The attribute name. |
$value | mixed | The value of the attribute. |
public setContent ( string | resource $content ) : void | ||
$content | string | resource | The body content, for example arguments of a PUT request, or a stream resource |
리턴 | void |
public static trimMediaType ( string $rawMediaType ) : string | ||
$rawMediaType | string | The full media type, for example "application/json; charset=UTF-8" |
리턴 | string | Just the type and subtype, for example "application/json" |
protected untangleFilesArray ( array $convolutedFiles ) : array | ||
$convolutedFiles | array | The _FILES superglobal |
리턴 | array | Untangled files |
public withAttribute ( string $name, mixed $value ) : self | ||
$name | string | The attribute name. |
$value | mixed | The value of the attribute. |
리턴 | self |
public withoutAttribute ( string $name ) : self | ||
$name | string | The attribute name. |
리턴 | self |
protected string $inputStreamUri | ||
리턴 | string |
protected array $server | ||
리턴 | array |