ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
|
Namespaces | |
Auth | |
Data Structures | |
class | Client |
A rudimentary HTTP client. More... | |
class | ClientException |
This exception may be emitted by the HTTP class, in case there was a problem emitting the request. More... | |
class | ClientHttpException |
This exception represents a HTTP error coming from the Client. More... | |
class | ClientMock |
class | ClientTest |
class | FunctionsTest |
interface | HttpException |
An exception representing a HTTP error. More... | |
class | Message |
This is the abstract base class for both the Request and Response objects. More... | |
class | MessageDecoratorTest |
interface | MessageInterface |
The MessageInterface is the base interface that's used by both the RequestInterface and ResponseInterface. More... | |
class | MessageMock |
class | MessageTest |
class | Request |
The Request class represents a single HTTP request. More... | |
class | RequestDecorator |
Request Decorator. More... | |
class | RequestDecoratorTest |
interface | RequestInterface |
The RequestInterface represents a HTTP request. More... | |
class | RequestTest |
class | Response |
This class represents a single HTTP response. More... | |
class | ResponseDecorator |
Response Decorator. More... | |
class | ResponseDecoratorTest |
interface | ResponseInterface |
This interface represents a HTTP response. More... | |
class | ResponseMock |
HTTP Response Mock object. More... | |
class | ResponseTest |
class | Sapi |
PHP SAPI. More... | |
class | SapiMock |
HTTP Response Mock object. More... | |
class | SapiTest |
class | URLUtil |
URL utility class. More... | |
class | URLUtilTest |
class | Util |
HTTP utility methods. More... | |
class | UtilTest |
class | Version |
This class contains the version number for the HTTP package. More... | |
Functions | |
parseDate ($dateString) | |
A collection of useful helpers for parsing or generating various HTTP headers. More... | |
toDate (DateTime $dateTime) | |
Transforms a DateTime object to a valid HTTP/1.1 Date header value. More... | |
negotiateContentType ($acceptHeaderValue, array $availableOptions) | |
This function can be used to aid with content negotiation. More... | |
parsePrefer ($input) | |
Parses the Prefer header, as defined in RFC7240. More... | |
getHeaderValues ($values, $values2=null) | |
This method splits up headers into all their individual values. More... | |
parseMimeType ($str) | |
Parses a mime-type and splits it into: More... | |
encodePath ($path) | |
Encodes the path of a url. More... | |
encodePathSegment ($pathSegment) | |
Encodes a 1 segment of a path. More... | |
decodePath ($path) | |
Decodes a url-encoded path. More... | |
decodePathSegment ($path) | |
Decodes a url-encoded path segment. More... | |
getBodyAsStream () | |
Returns the body as a readable stream resource. More... | |
getBodyAsString () | |
Returns the body as a string. More... | |
getBody () | |
Returns the message body, as it's internal representation. More... | |
setBody ($body) | |
Updates the body resource with a new stream. More... | |
getHeaders () | |
Returns all the HTTP headers as an array. More... | |
hasHeader ($name) | |
Will return true or false, depending on if a HTTP header exists. More... | |
getHeader ($name) | |
Returns a specific HTTP header, based on it's name. More... | |
getHeaderAsArray ($name) | |
Returns a HTTP header as an array. More... | |
setHeader ($name, $value) | |
Updates a HTTP header. More... | |
setHeaders (array $headers) | |
Sets a new set of HTTP headers. More... | |
addHeader ($name, $value) | |
Adds a HTTP header. More... | |
addHeaders (array $headers) | |
Adds a new set of HTTP headers. More... | |
removeHeader ($name) | |
Removes a HTTP header. More... | |
setHttpVersion ($version) | |
Sets the HTTP version. More... | |
getHttpVersion () | |
Returns the HTTP version. More... | |
Variables | |
trait | MessageDecoratorTrait |
This trait contains a bunch of methods, shared by both the RequestDecorator and the ResponseDecorator. More... | |
Sabre\HTTP\addHeader | ( | $name, | |
$value | |||
) |
Adds a HTTP header.
This method will not overwrite any existing HTTP header, but instead add another value. Individual values can be retrieved with getHeadersAsArray.
string | $name | |
string | $value |
Definition at line 189 of file MessageDecoratorTrait.php.
References $name.
Sabre\HTTP\addHeaders | ( | array | $headers | ) |
Adds a new set of HTTP headers.
Any existing headers will not be overwritten.
array | $headers |
Definition at line 203 of file MessageDecoratorTrait.php.
Sabre\HTTP\decodePath | ( | $path | ) |
Decodes a url-encoded path.
string | $path |
Definition at line 419 of file functions.php.
References $path, and Sabre\HTTP\decodePathSegment().
Sabre\HTTP\decodePathSegment | ( | $path | ) |
Decodes a url-encoded path segment.
string | $path |
Definition at line 431 of file functions.php.
References $path.
Referenced by Sabre\HTTP\decodePath().
Sabre\HTTP\encodePath | ( | $path | ) |
Encodes the path of a url.
slashes (/) are treated as path-separators.
string | $path |
Definition at line 386 of file functions.php.
References $path.
Referenced by Sabre\DAV\Xml\Property\LocalHref\__construct(), Sabre\CalDAV\Backend\PDO\getInvites(), and Sabre\DAV\Xml\Element\Response\xmlSerialize().
Sabre\HTTP\encodePathSegment | ( | $pathSegment | ) |
Encodes a 1 segment of a path.
Slashes are considered part of the name, and are encoded as %2f
string | $pathSegment |
Definition at line 404 of file functions.php.
Sabre\HTTP\getBody | ( | ) |
Returns the message body, as it's internal representation.
This could be either a string or a stream.
Definition at line 62 of file MessageDecoratorTrait.php.
Sabre\HTTP\getBodyAsStream | ( | ) |
Returns the body as a readable stream resource.
Note that the stream may not be rewindable, and therefore may only be read once.
Definition at line 35 of file MessageDecoratorTrait.php.
Sabre\HTTP\getBodyAsString | ( | ) |
Returns the body as a string.
Note that because the underlying data may be based on a stream, this method could only work correctly the first time.
Definition at line 49 of file MessageDecoratorTrait.php.
Referenced by Sabre\HTTP\ClientTest\testParseCurlResult().
Sabre\HTTP\getHeader | ( | $name | ) |
Returns a specific HTTP header, based on it's name.
The name must be treated as case-insensitive. If the header does not exist, this method must return null.
If a header appeared more than once in a HTTP request, this method will concatenate all the values with a comma.
Note that this not make sense for all headers. Some, such as Set-Cookie
cannot be logically combined with a comma. In those cases you should use getHeaderAsArray().
string | $name |
Definition at line 121 of file MessageDecoratorTrait.php.
References $name.
Sabre\HTTP\getHeaderAsArray | ( | $name | ) |
Returns a HTTP header as an array.
For every time the HTTP header appeared in the request or response, an item will appear in the array.
If the header did not exists, this method will return an empty array.
string | $name |
Definition at line 138 of file MessageDecoratorTrait.php.
References $name.
Sabre\HTTP\getHeaders | ( | ) |
Returns all the HTTP headers as an array.
Every header is returned as an array, with one or more values.
Definition at line 87 of file MessageDecoratorTrait.php.
Referenced by Sabre\HTTP\ClientTest\testParseCurlResult().
Sabre\HTTP\getHeaderValues | ( | $values, | |
$values2 = null |
|||
) |
This method splits up headers into all their individual values.
A HTTP header may have more than one header, such as this: Cache-Control: private, no-store
Header values are always split with a comma.
You can pass either a string, or an array. The resulting value is always an array with each spliced value.
If the second headers argument is set, this value will simply be merged in. This makes it quicker to merge an old list of values with a new set.
string|string[] | $values |
string|string[] | $values2 |
Definition at line 301 of file functions.php.
References $result, and $values.
Referenced by Sabre\HTTP\parsePrefer(), and Sabre\HTTP\FunctionsTest\testGetHeaderValues().
Sabre\HTTP\getHttpVersion | ( | ) |
Sabre\HTTP\hasHeader | ( | $name | ) |
Will return true or false, depending on if a HTTP header exists.
string | $name |
Definition at line 99 of file MessageDecoratorTrait.php.
References $name.
Sabre\HTTP\negotiateContentType | ( | $acceptHeaderValue, | |
array | $availableOptions | ||
) |
This function can be used to aid with content negotiation.
It takes 2 arguments, the $acceptHeaderValue, which usually comes from an Accept header, and $availableOptions, which contains an array of items that the server can support.
The result of this function will be the 'best possible option'. If no best possible option could be found, null is returned.
When it's null you can according to the spec either return a default, or you can choose to emit 406 Not Acceptable.
The method also accepts sending 'null' for the $acceptHeaderValue, implying that no accept header was sent.
string | null | $acceptHeaderValue | |
array | $availableOptions |
Definition at line 107 of file functions.php.
References PHPMailer\PHPMailer\$options.
Sabre\HTTP\parseDate | ( | $dateString | ) |
A collection of useful helpers for parsing or generating various HTTP headers.
This method returns false if the date is invalid.
The following formats are supported: Sun, 06 Nov 1994 08:49:37 GMT ; IMF-fixdate Sunday, 06-Nov-94 08:49:37 GMT ; obsolete RFC 850 format Sun Nov 6 08:49:37 1994 ; ANSI C's asctime() format
See: http://tools.ietf.org/html/rfc7231#section-7.1.1.1
string | $dateString |
Definition at line 32 of file functions.php.
References $time.
Referenced by Sabre\VObject\DateTimeParser\parse(), and Sabre\HTTP\Util\parseHTTPDate().
Sabre\HTTP\parseMimeType | ( | $str | ) |
Parses a mime-type and splits it into:
string | $str |
Definition at line 327 of file functions.php.
References $type.
Sabre\HTTP\parsePrefer | ( | $input | ) |
Parses the Prefer header, as defined in RFC7240.
Input can be given as a single header value (string) or multiple headers (array of string).
This method will return a key->value array with the various Prefer parameters.
Prefer: return=minimal will result in:
[ 'return' => 'minimal' ]
Prefer: foo, wait=10 will result in:
[ 'foo' => true, 'wait' => '10']
This method also supports the formats from older drafts of RFC7240, and it will automatically map them to the new values, as the older values are still pretty common.
Parameters are currently discarded. There's no known prefer value that uses them.
string|string[] | $input |
Definition at line 222 of file functions.php.
References $input, Sabre\VObject\$output, PHPMailer\PHPMailer\$token, Sabre\HTTP\getHeaderValues(), and Sabre\VObject\property.
Referenced by Sabre\DAV\Server\getHTTPPrefer(), and Sabre\HTTP\FunctionsTest\testPrefer().
Sabre\HTTP\removeHeader | ( | $name | ) |
Removes a HTTP header.
The specified header name must be treated as case-insensitive. This method should return true if the header was successfully deleted, and false if the header did not exist.
string | $name |
Definition at line 220 of file MessageDecoratorTrait.php.
References $name.
Sabre\HTTP\setBody | ( | $body | ) |
Updates the body resource with a new stream.
resource | $body |
Definition at line 74 of file MessageDecoratorTrait.php.
Sabre\HTTP\setHeader | ( | $name, | |
$value | |||
) |
Updates a HTTP header.
The case-sensitivity of the name value must be retained as-is.
If the header already existed, it will be overwritten.
string | $name | |
string|string[] | $value |
Definition at line 155 of file MessageDecoratorTrait.php.
References $name.
Referenced by soap_transport_http\__construct(), soap_transport_http\buildPayload(), soap_transport_http\connect(), Gettext\Translations\mergeWith(), soap_transport_http\setContentType(), soap_transport_http\setCredentials(), Gettext\Translations\setDomain(), soap_transport_http\setEncoding(), Gettext\Translations\setLanguage(), Gettext\Translations\setPluralForms(), soap_transport_http\setProxy(), soap_transport_http\setSOAPAction(), soap_transport_http\setURL(), and soap_transport_http\usePersistentConnection().
Sabre\HTTP\setHeaders | ( | array | $headers | ) |
Sets a new set of HTTP headers.
The headers array should contain headernames for keys, and their value should be specified as either a string or an array.
Any header that already existed will be overwritten.
array | $headers |
Definition at line 172 of file MessageDecoratorTrait.php.
Sabre\HTTP\setHttpVersion | ( | $version | ) |
Sets the HTTP version.
Should be 1.0 or 1.1.
string | $version |
Definition at line 234 of file MessageDecoratorTrait.php.
References $version.
Sabre\HTTP\toDate | ( | DateTime | $dateTime | ) |
Transforms a DateTime object to a valid HTTP/1.1 Date header value.
DateTime | $dateTime |
Definition at line 77 of file functions.php.
Referenced by Sabre\HTTP\Util\toHTTPDate().
trait Sabre::HTTP\MessageDecoratorTrait |
This trait contains a bunch of methods, shared by both the RequestDecorator and the ResponseDecorator.
Didn't seem needed to create a full class for this, so we're just implementing it as a trait.
Definition at line 16 of file MessageDecoratorTrait.php.