Verzeichnisstruktur phpBB-3.3.15


Veröffentlicht
28.08.2024

So funktioniert es


Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück

Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis.
Auf den Verzeichnisnamen klicken, dies zeigt nur das Verzeichnis mit Inhalt an

(Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

PSR7-Interfaces.md

Zuletzt modifiziert: 02.04.2025, 15:03 - Dateigröße: 9.32 KiB


001  # Interfaces
002   
003  The purpose of this list is to help in finding the methods when working with PSR-7. This can be considered as a cheatsheet for PSR-7 interfaces.
004   
005  The interfaces defined in PSR-7 are the following:
006   
007  | Class Name | Description |
008  |---|---|
009  | [Psr\Http\Message\MessageInterface](http://www.php-fig.org/psr/psr-7/#psrhttpmessagemessageinterface) | Representation of a HTTP message |
010  | [Psr\Http\Message\RequestInterface](http://www.php-fig.org/psr/psr-7/#psrhttpmessagerequestinterface) | Representation of an outgoing, client-side request. |
011  | [Psr\Http\Message\ServerRequestInterface](http://www.php-fig.org/psr/psr-7/#psrhttpmessageserverrequestinterface) | Representation of an incoming, server-side HTTP request. | 
012  | [Psr\Http\Message\ResponseInterface](http://www.php-fig.org/psr/psr-7/#psrhttpmessageresponseinterface) | Representation of an outgoing, server-side response. |
013  | [Psr\Http\Message\StreamInterface](http://www.php-fig.org/psr/psr-7/#psrhttpmessagestreaminterface) | Describes a data stream |
014  | [Psr\Http\Message\UriInterface](http://www.php-fig.org/psr/psr-7/#psrhttpmessageuriinterface) | Value object representing a URI. |
015  | [Psr\Http\Message\UploadedFileInterface](http://www.php-fig.org/psr/psr-7/#psrhttpmessageuploadedfileinterface) | Value object representing a file uploaded through an HTTP request. |
016   
017  ## `Psr\Http\Message\MessageInterface` Methods
018   
019  | Method Name                        | Description | Notes |
020  |------------------------------------| ----------- | ----- |
021  | `getProtocolVersion()`             | Retrieve HTTP protocol version          |  1.0 or 1.1 |
022  | `withProtocolVersion($version)`    | Returns new message instance with given HTTP protocol version          |      |
023  | `getHeaders()`                     | Retrieve all HTTP Headers               | [Request Header List](https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#Request_fields), [Response Header List](https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#Response_fields)      |
024  | `hasHeader($name)`                 | Checks if HTTP Header with given name exists  | |
025  | `getHeader($name)`                 | Retrieves a array with the values for a single header | |
026  | `getHeaderLine($name)`             | Retrieves a comma-separated string of the values for a single header |  |
027  | `withHeader($name, $value)`        | Returns new message instance with given HTTP Header | if the header existed in the original instance, replaces the header value from the original message with the value provided when creating the new instance. |
028  | `withAddedHeader($name, $value)`   | Returns new message instance with appended value to given header | If header already exists value will be appended, if not a new header will be created |
029  | `withoutHeader($name)`             | Removes HTTP Header with given name| |
030  | `getBody()`                        | Retrieves the HTTP Message Body | Returns object implementing `StreamInterface`|
031  | `withBody(StreamInterface $body)`  | Returns new message instance with given HTTP Message Body | |
032   
033   
034  ## `Psr\Http\Message\RequestInterface` Methods
035   
036  Same methods as `Psr\Http\Message\MessageInterface`  + the following methods:
037   
038  | Method Name                        | Description | Notes |
039  |------------------------------------| ----------- | ----- |
040  | `getRequestTarget()`                | Retrieves the message's request target              | origin-form, absolute-form, authority-form, asterisk-form ([RFC7230](https://www.rfc-editor.org/rfc/rfc7230.txt)) |
041  | `withRequestTarget($requestTarget)` | Return a new message instance with the specific request-target |      |
042  | `getMethod()`                       | Retrieves the HTTP method of the request.  |  GET, HEAD, POST, PUT, DELETE, CONNECT, OPTIONS, TRACE (defined in [RFC7231](https://tools.ietf.org/html/rfc7231)), PATCH (defined in [RFC5789](https://tools.ietf.org/html/rfc5789)) |
043  | `withMethod($method)`               | Returns a new message instance with the provided HTTP method  | |
044  | `getUri()`                 | Retrieves the URI instance | |
045  | `withUri(UriInterface $uri, $preserveHost = false)` | Returns a new message instance with the provided URI |  |
046   
047   
048  ## `Psr\Http\Message\ServerRequestInterface` Methods
049   
050  Same methods as `Psr\Http\Message\RequestInterface`  + the following methods:
051   
052  | Method Name                        | Description | Notes |
053  |------------------------------------| ----------- | ----- |
054  | `getServerParams() `               | Retrieve server parameters  | Typically derived from `$_SERVER`  |
055  | `getCookieParams()`                | Retrieves cookies sent by the client to the server. | Typically derived from `$_COOKIES` |
056  | `withCookieParams(array $cookies)` |  Returns a new request instance with the specified cookies      |   | 
057  | `withQueryParams(array $query)` | Returns a new request instance with the specified query string arguments  |  |
058  | `getUploadedFiles()` | Retrieve normalized file upload data  |  |
059  | `withUploadedFiles(array $uploadedFiles)` | Returns a new request instance with the specified uploaded files  |  |
060  | `getParsedBody()` | Retrieve any parameters provided in the request body  |  |
061  | `withParsedBody($data)` | Returns a new request instance with the specified body parameters  |  |
062  | `getAttributes()` | Retrieve attributes derived from the request  |  |
063  | `getAttribute($name, $default = null)` | Retrieve a single derived request attribute  |  |
064  | `withAttribute($name, $value)` | Returns a new request instance with the specified derived request attribute  |  |
065  | `withoutAttribute($name)` | Returns a new request instance that without the specified derived request attribute  |  |
066   
067  ## `Psr\Http\Message\ResponseInterface` Methods:
068   
069  Same methods as `Psr\Http\Message\MessageInterface`  + the following methods:
070   
071  | Method Name                        | Description | Notes |
072  |------------------------------------| ----------- | ----- |
073  | `getStatusCode()` | Gets the response status code. | |
074  | `withStatus($code, $reasonPhrase = '')` | Returns a new response instance with the specified status code and, optionally, reason phrase. | |
075  | `getReasonPhrase()` | Gets the response reason phrase associated with the status code. | |
076   
077  ##  `Psr\Http\Message\StreamInterface` Methods
078   
079  | Method Name                        | Description | Notes |
080  |------------------------------------| ----------- | ----- |
081  | `__toString()` | Reads all data from the stream into a string, from the beginning to end. | |
082  | `close()` | Closes the stream and any underlying resources. | |
083  | `detach()` | Separates any underlying resources from the stream. | |
084  | `getSize()` | Get the size of the stream if known. | |
085  | `eof()` | Returns true if the stream is at the end of the stream.| |
086  | `isSeekable()` |  Returns whether or not the stream is seekable. | |
087  | `seek($offset, $whence = SEEK_SET)` | Seek to a position in the stream. | |
088  | `rewind()` | Seek to the beginning of the stream. | |
089  | `isWritable()` | Returns whether or not the stream is writable. | |
090  | `write($string)` | Write data to the stream. | |
091  | `isReadable()` | Returns whether or not the stream is readable. | |
092  | `read($length)` | Read data from the stream. | |
093  | `getContents()` | Returns the remaining contents in a string | |
094  | `getMetadata($key = null)()` | Get stream metadata as an associative array or retrieve a specific key. | |
095   
096  ## `Psr\Http\Message\UriInterface` Methods
097   
098  | Method Name                        | Description | Notes |
099  |------------------------------------| ----------- | ----- |
100  | `getScheme()` | Retrieve the scheme component of the URI. | |
101  | `getAuthority()` | Retrieve the authority component of the URI. | |
102  | `getUserInfo()` | Retrieve the user information component of the URI. | |
103  | `getHost()` | Retrieve the host component of the URI. | |
104  | `getPort()` | Retrieve the port component of the URI. | |
105  | `getPath()` | Retrieve the path component of the URI. | |
106  | `getQuery()` | Retrieve the query string of the URI. | |
107  | `getFragment()` | Retrieve the fragment component of the URI. | |
108  | `withScheme($scheme)` | Return an instance with the specified scheme. | |
109  | `withUserInfo($user, $password = null)` | Return an instance with the specified user information. | |
110  | `withHost($host)` | Return an instance with the specified host. | |
111  | `withPort($port)` | Return an instance with the specified port. | |
112  | `withPath($path)` | Return an instance with the specified path. | |
113  | `withQuery($query)` | Return an instance with the specified query string. | |
114  | `withFragment($fragment)` | Return an instance with the specified URI fragment. | |
115  | `__toString()` | Return the string representation as a URI reference. | |
116   
117  ## `Psr\Http\Message\UploadedFileInterface` Methods
118   
119  | Method Name                        | Description | Notes |
120  |------------------------------------| ----------- | ----- |
121  | `getStream()` | Retrieve a stream representing the uploaded file. | |
122  | `moveTo($targetPath)` | Move the uploaded file to a new location. | |
123  | `getSize()` | Retrieve the file size. | |
124  | `getError()` | Retrieve the error associated with the uploaded file. | |
125  | `getClientFilename()` | Retrieve the filename sent by the client. | |
126  | `getClientMediaType()` | Retrieve the media type sent by the client. | |
127   
128  > `RequestInterface`, `ServerRequestInterface`, `ResponseInterface` extend `MessageInterface`  because the `Request` and the `Response` are `HTTP Messages`.
129  > When using `ServerRequestInterface`, both `RequestInterface` and `Psr\Http\Message\MessageInterface` methods are considered.
130   
131