Joomla CMS
4.2.2
Documentation des API du CMS Joomla en version 4.2.2
|
Espaces de nommage | |
Exception | |
Request | |
Response | |
Structures de données | |
class | AbstractSerializer |
class | CallbackStream |
class | ConfigProvider |
class | HeaderSecurity |
class | Module |
class | PhpInputStream |
class | RelativeStream |
class | Request |
class | RequestFactory |
class | Response |
class | ResponseFactory |
class | ServerRequest |
class | ServerRequestFactory |
class | Stream |
class | StreamFactory |
class | UploadedFile |
class | UploadedFileFactory |
class | Uri |
class | UriFactory |
Variables | |
trait | MessageTrait |
$headerNames = [] | |
$protocol = '1.1' | |
$stream | |
trait | RequestTrait |
$method = 'GET' | |
$requestTarget | |
$uri | |
|
private |
Ensure header name and values are valid.
string | $name |
Exception |
Références $name, et HeaderSecurity\assertValidName().
Référencé par Laminas\Diactoros\setHeaders(), Laminas\Diactoros\withAddedHeader(), et Laminas\Diactoros\withHeader().
Laminas\Diactoros\createUploadedFile | ( | array | $spec | ) |
Create an uploaded file instance from an array of values.
array | $spec | A single $_FILES entry. |
Exception |
Références null.
Référencé par Laminas\Diactoros\normalizeUploadedFiles().
|
private |
Create and return a URI instance.
If $uri
is a already a UriInterface
instance, returns it.
If $uri
is a string, passes it to the Uri
constructor to return an instance.
If $uri is null, creates and returns an empty
Uri` instance.
Otherwise, it raises an exception.
null | string | UriInterface | $uri |
Exception |
Références Laminas\Diactoros\$uri, et null.
Référencé par Router\build(), et Laminas\Diactoros\initialize().
|
private |
mixed | $values |
Références $value, et HeaderSecurity\assertValid().
Référencé par Laminas\Diactoros\setHeaders(), Laminas\Diactoros\withAddedHeader(), et Laminas\Diactoros\withHeader().
Laminas\Diactoros\getBody | ( | ) |
Gets the body of the message.
Références Laminas\Diactoros\$stream.
Référencé par Cache\onAfterRespond(), et CMSApplication\toString().
Laminas\Diactoros\getHeader | ( | $header | ) |
Retrieves a message header value by the given case-insensitive name.
This method returns an array of all the header values of the given case-insensitive header name.
If the header does not appear in the message, this method MUST return an empty array.
string | $header | Case-insensitive header field name. |
Références $header, et Laminas\Diactoros\hasHeader().
Référencé par Laminas\Diactoros\getHeaderLine().
Laminas\Diactoros\getHeaderLine | ( | $name | ) |
Retrieves a comma-separated string of the values for a single header.
This method returns all of the header values of the given case-insensitive header name as a string concatenated together using a comma.
NOTE: Not all header values may be appropriately represented using comma concatenation. For such headers, use getHeader() instead and supply your own delimiter when concatenating.
If the header does not appear in the message, this method MUST return an empty string.
string | $name | Case-insensitive header field name. |
Références $name, $value, et Laminas\Diactoros\getHeader().
Laminas\Diactoros\getHeaders | ( | ) |
Retrieves all message headers.
The keys represent the header name as it will be sent over the wire, and each value is an array of strings associated with the header.
// Represent the headers as a string foreach ($message->getHeaders() as $name => $values) { echo $name . ": " . implode(", ", $values); } // Emit headers iteratively: foreach ($message->getHeaders() as $name => $values) { foreach ($values as $value) { header(sprintf('%s: %s', $name, $value), false); } }
|
private |
Retrieve the host from the URI instance
Référencé par Request\getHeader(), Request\getHeaders(), et Laminas\Diactoros\initialize().
Laminas\Diactoros\getMethod | ( | ) |
Retrieves the HTTP method of the request.
Références Laminas\Diactoros\$method.
Laminas\Diactoros\getProtocolVersion | ( | ) |
Retrieves the HTTP protocol version as a string.
The string MUST contain only the HTTP version number (e.g., "1.1", "1.0").
Références Laminas\Diactoros\$protocol.
Laminas\Diactoros\getRequestTarget | ( | ) |
Retrieves the message's request target.
Retrieves the message's request-target either as it will appear (for clients), as it appeared at request (for servers), or as it was specified for the instance (see withRequestTarget()).
In most cases, this will be the origin-form of the composed URI, unless a value was provided to the concrete implementation (see withRequestTarget() below).
If no URI is available, and no request-target has been specifically provided, this method MUST return the string "/".
Références Laminas\Diactoros\$requestTarget, $target, et null.
|
private |
Références Laminas\Diactoros\$stream.
Référencé par Response\__construct(), et Laminas\Diactoros\initialize().
Laminas\Diactoros\getUri | ( | ) |
Retrieves the URI instance.
This method MUST return a UriInterface instance.
UriInterface Returns a UriInterface instance representing the URI of the request, if any.
Références Laminas\Diactoros\$uri.
Laminas\Diactoros\hasHeader | ( | $header | ) |
Checks if a header exists by the given case-insensitive name.
string | $header | Case-insensitive header name. |
Références $header.
Référencé par Laminas\Diactoros\getHeader(), Laminas\Diactoros\initialize(), AbstractWebApplication\respond(), Laminas\Diactoros\withAddedHeader(), Laminas\Diactoros\withoutHeader(), et Laminas\Diactoros\withUri().
|
private |
Initialize request state.
Used by constructors.
null | string | UriInterface | $uri | URI for the request, if any. |
null | string | $method | HTTP method for the request, if any. |
string | resource | StreamInterface | $body | Message body, if any. |
array | $headers | Headers for the message, if any. |
Exception |
Références Laminas\Diactoros\$method, Laminas\Diactoros\$uri, Laminas\Diactoros\createUri(), Laminas\Diactoros\getHostFromUri(), Laminas\Diactoros\getStream(), Laminas\Diactoros\hasHeader(), null, Laminas\Diactoros\setHeaders(), et Laminas\Diactoros\setMethod().
Référencé par Request\__construct(), Encrypt\__construct(), ServerRequest\__construct(), Engine\__construct(), PHP32\initialize(), PHP64\initialize(), et Inline\parse().
Laminas\Diactoros\marshalHeadersFromSapi | ( | array | $server | ) |
array | $server | Values obtained from the SAPI (generally $_SERVER ). |
Références $key, $name, et $value.
Référencé par ServerRequestFactory\fromGlobals().
Laminas\Diactoros\marshalMethodFromSapi | ( | array | $server | ) |
Retrieve the request method from the SAPI parameters.
Référencé par ServerRequestFactory\fromGlobals().
Laminas\Diactoros\marshalProtocolVersionFromSapi | ( | array | $server | ) |
Return HTTP protocol version (X.Y) as discovered within a $_SERVER
array.
Exception |
Références UnrecognizedProtocolVersionException\forVersion().
Référencé par ServerRequestFactory\fromGlobals().
Laminas\Diactoros\marshalUriFromSapi | ( | array | $server, |
array | $headers | ||
) |
Marshal a Uri instance based on the values presnt in the $_SERVER array and headers.
array | $server | SAPI parameters |
array | $headers | HTTP request headers |
Retrieve a header value from an array of headers using a case-insensitive lookup.
array | $headers | Key/value header pairs |
mixed | $default | Default value to return if header not found |
Marshal the host and port from HTTP headers and/or the PHP environment.
string | array | $host |
Detect the path for the request
Looks at a variety of criteria in order to attempt to autodetect the base request path, including:
From Laminas class
Références $default, $header, $name, $path, $query, Laminas\Diactoros\$uri, $value, elseif, et null.
Référencé par ServerRequestFactory\fromGlobals().
Laminas\Diactoros\normalizeServer | ( | array | $server, |
callable | $apacheRequestHeaderCallback = null |
||
) |
Marshal the $_SERVER array
Pre-processes and returns the $_SERVER superglobal. In particularly, it attempts to detect the Authorization header, which is often not aggregated correctly under various SAPI/httpd combinations.
null | callable | $apacheRequestHeaderCallback | Callback that can be used to retrieve Apache request headers. This defaults to apache_request_headers under the Apache mod_php. |
Références null.
Référencé par ServerRequestFactory\fromGlobals().
Laminas\Diactoros\normalizeUploadedFiles | ( | array | $files | ) |
Normalize uploaded files
Transforms each value into an UploadedFile instance, and ensures that nested arrays are normalized.
Exception |
Traverse a nested tree of uploaded file specifications.
string[]|array[] | $tmpNameTree |
int[]|array[] | $sizeTree |
int[]|array[] | $errorTree |
string[]|array[]|null | $nameTree |
string[]|array[]|null | $typeTree |
Normalize an array of file specifications.
Loops through all nested files (as determined by receiving an array to the tmp_name
key of a $_FILES
specification) and returns a normalized array of UploadedFile instances.
This function normalizes a $_FILES
array representing a nested set of uploaded files as produced by the php-fpm SAPI, CGI SAPI, or mod_php SAPI.
array | $files |
Références $key, $value, Laminas\Diactoros\createUploadedFile(), et null.
Référencé par ServerRequestFactory\fromGlobals().
Laminas\Diactoros\parseCookieHeader | ( | $cookieHeader | ) |
Parse a cookie header according to RFC 6265.
PHP will replace special characters in cookie names, which results in other cookies not being available due to overwriting. Thus, the server request should take the cookies from the request header instead.
string | $cookieHeader | A string cookie header value. |
Référencé par ServerRequestFactory\fromGlobals().
|
private |
Filter a set of headers to ensure they are in the correct internal format.
Used by message constructors to allow setting all initial headers at once.
array | $originalHeaders | Headers to filter. |
Références $header, Laminas\Diactoros\$headerNames, $value, Laminas\Diactoros\assertHeader(), et Laminas\Diactoros\filterHeaderValue().
Référencé par Response\__construct(), Laminas\Diactoros\initialize(), et SerializerErrorRenderer\render().
|
private |
Set and validate the HTTP method
string | $method |
Exception |
Références Laminas\Diactoros\$method, et method.
Référencé par Laminas\Diactoros\initialize().
|
private |
Validate the HTTP protocol version
string | $version |
Exception |
Références $version.
Référencé par Laminas\Diactoros\withProtocolVersion().
Laminas\Diactoros\withAddedHeader | ( | $header, | |
$value | |||
) |
Return an instance with the specified header appended with the given value.
Existing values for the specified header will be maintained. The new value(s) will be appended to the existing list. If the header did not exist previously, it will be added.
This method MUST be implemented in such a way as to retain the immutability of the message, and MUST return an instance that has the new header and/or value.
string | $header | Case-insensitive header field name to add. |
string|string[] | $value Header value(s). |
Exception |
Références $header, $this, $value, Laminas\Diactoros\assertHeader(), Laminas\Diactoros\filterHeaderValue(), Laminas\Diactoros\hasHeader(), et Laminas\Diactoros\withHeader().
Laminas\Diactoros\withBody | ( | StreamInterface | $body | ) |
Return an instance with the specified message body.
The body MUST be a StreamInterface object.
This method MUST be implemented in such a way as to retain the immutability of the message, and MUST return a new instance that has the new body stream.
StreamInterface | $body | Body. |
Exception |
Références $this.
Référencé par AbstractWebApplication\appendBody(), AbstractWebApplication\prependBody(), et AbstractWebApplication\setBody().
Laminas\Diactoros\withHeader | ( | $header, | |
$value | |||
) |
Return an instance with the provided header, replacing any existing values of any headers with the same case-insensitive name.
While header names are case-insensitive, the casing of the header will be preserved by this function, and returned from getHeaders().
This method MUST be implemented in such a way as to retain the immutability of the message, and MUST return an instance that has the new and/or updated header and value.
string | $header | Case-insensitive header field name. |
string|string[] | $value Header value(s). |
Exception |
Références $header, $this, $value, Laminas\Diactoros\assertHeader(), et Laminas\Diactoros\filterHeaderValue().
Référencé par Laminas\Diactoros\withAddedHeader().
Laminas\Diactoros\withMethod | ( | $method | ) |
Return an instance with the provided HTTP method.
While HTTP method names are typically all uppercase characters, HTTP method names are case-sensitive and thus implementations SHOULD NOT modify the given string.
This method MUST be implemented in such a way as to retain the immutability of the message, and MUST return an instance that has the changed request method.
string | $method | Case-insensitive method. |
Exception |
Références Laminas\Diactoros\$method, et $this.
Laminas\Diactoros\withoutHeader | ( | $header | ) |
Return an instance without the specified header.
Header resolution MUST be done without case-sensitivity.
This method MUST be implemented in such a way as to retain the immutability of the message, and MUST return an instance that removes the named header.
string | $header | Case-insensitive header field name to remove. |
Références $header, $this, et Laminas\Diactoros\hasHeader().
Laminas\Diactoros\withProtocolVersion | ( | $version | ) |
Return an instance with the specified HTTP protocol version.
The version string MUST contain only the HTTP version number (e.g., "1.1", "1.0").
This method MUST be implemented in such a way as to retain the immutability of the message, and MUST return an instance that has the new protocol version.
string | $version | HTTP protocol version |
Références $this, $version, et Laminas\Diactoros\validateProtocolVersion().
Laminas\Diactoros\withRequestTarget | ( | $requestTarget | ) |
Create a new instance with a specific request-target.
If the request needs a non-origin-form request-target — e.g., for specifying an absolute-form, authority-form, or asterisk-form — this method may be used to create an instance with the specified request-target, verbatim.
This method MUST be implemented in such a way as to retain the immutability of the message, and MUST return a new instance that has the changed request target.
Références Laminas\Diactoros\$requestTarget, et $this.
Laminas\Diactoros\withUri | ( | UriInterface | $uri, |
$preserveHost = false |
|||
) |
Returns an instance with the provided URI.
This method will update the Host header of the returned request by default if the URI contains a host component. If the URI does not contain a host component, any pre-existing Host header will be carried over to the returned request.
You can opt-in to preserving the original state of the Host header by setting $preserveHost
to true
. When $preserveHost
is set to true
, the returned request will not update the Host header of the returned message – even if the message contains no Host header. This means that a call to ‘getHeader('Host’)on the original request MUST equal the return value of a call to
getHeader('Host')` on the returned request.
This method MUST be implemented in such a way as to retain the immutability of the message, and MUST return an instance that has the new UriInterface instance.
Références $header, $this, Laminas\Diactoros\$uri, et Laminas\Diactoros\hasHeader().
|
protected |
Référencé par Laminas\Diactoros\setHeaders().
|
private |
Référencé par Request\__construct(), ServerRequest\__construct(), RequestFactory\createRequest(), ServerRequestFactory\createServerRequest(), ArraySerializer\fromArray(), Serializer\fromStream(), Laminas\Diactoros\getMethod(), Laminas\Diactoros\initialize(), Laminas\Diactoros\setMethod(), et Laminas\Diactoros\withMethod().
|
private |
|
private |
|
private |
Référencé par FeedParser\__construct(), Stream\_getFilename(), File\append(), AbstractWebApplication\appendBody(), QuestionHelper\ask(), ResourceCaster\castStream(), ResourceCaster\castStreamContext(), AuthenticatorAssertionResponseValidator\check(), Path\clean(), Folder\copy(), File\copy(), Symfony\Component\Console\Tester\createStream(), UploadedFileFactory\createUploadedFile(), Decoder\decode(), Serializer\fromStream(), Serializer\fromString(), Laminas\Diactoros\getBody(), AbstractSerializer\getLine(), DumpServer\getMessages(), TPMAttestationStatementSupport\getParameters(), Serializer\getRequestLine(), Serializer\getStatusLine(), Laminas\Diactoros\getStream(), CliDumper\hasColorSupport(), AttestationObjectLoader\load(), File\move(), Folder\move(), AbstractWebApplication\prependBody(), Decoder\process(), Decoder\processFinite(), Decoder\processInfinite(), Stream\request(), StreamTransport\request(), Php72\sapi_windows_vt100_support(), AbstractWebApplication\setBody(), AbstractSerializer\splitStream(), Php72\stream_isatty(), File\upload(), et File\write().
|
private |
Référencé par Request\__construct(), RedirectResponse\__construct(), ServerRequest\__construct(), Uri\__construct(), RequestFactory\createRequest(), ServerRequestFactory\createServerRequest(), UriFactory\createUri(), Laminas\Diactoros\createUri(), Uri\createUriString(), ArraySerializer\fromArray(), Serializer\fromStream(), Laminas\Diactoros\getUri(), Laminas\Diactoros\initialize(), Laminas\Diactoros\marshalUriFromSapi(), Uri\parseUri(), et Laminas\Diactoros\withUri().
trait MessageTrait |
Trait implementing the various methods defined in MessageInterface.
trait RequestTrait |
Trait with common request behaviors.
Server and client-side requests differ slightly in how the Host header is handled; on client-side, it should be calculated on-the-fly from the composed URI (if present), while on server-side, it will be calculated from the environment. As such, this trait exists to provide the common code between both client-side and server-side requests, and each can then use the headers functionality required by their implementations.