ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
|
Public Member Functions | |
__construct (array $settings) | |
Constructor. More... | |
propFind ($url, array $properties, $depth=0) | |
Does a PROPFIND request. More... | |
propPatch ($url, array $properties) | |
Updates a list of properties on the server. More... | |
options () | |
Performs an HTTP options request. More... | |
request ($method, $url='', $body=null, array $headers=[]) | |
Performs an actual HTTP request, and returns the result. More... | |
getAbsoluteUrl ($url) | |
Returns the full url based on the given url (which may be relative). More... | |
parseMultiStatus ($body) | |
Parses a WebDAV multistatus response body. More... | |
Public Member Functions inherited from Sabre\HTTP\Client | |
__construct () | |
Initializes the client. More... | |
send (RequestInterface $request) | |
Sends a request to a HTTP server, and returns a response. More... | |
sendAsync (RequestInterface $request, callable $success=null, callable $error=null) | |
Sends a HTTP request asynchronously. More... | |
poll () | |
This method checks if any http requests have gotten results, and if so, call the appropriate success or error handlers. More... | |
wait () | |
Processes every HTTP request in the queue, and waits till they are all completed. More... | |
setThrowExceptions ($throwExceptions) | |
If this is set to true, the Client will automatically throw exceptions upon HTTP errors. More... | |
addCurlSetting ($name, $value) | |
Adds a CURL setting. More... | |
Public Member Functions inherited from Sabre\Event\EventEmitterInterface | |
on ($eventName, callable $callBack, $priority=100) | |
Subscribe to an event. More... | |
once ($eventName, callable $callBack, $priority=100) | |
Subscribe to an event exactly once. More... | |
emit ($eventName, array $arguments=[], callable $continueCallBack=null) | |
Emits an event. More... | |
listeners ($eventName) | |
Returns the list of listeners for an event. More... | |
removeListener ($eventName, callable $listener) | |
Removes a specific listener from an event. More... | |
removeAllListeners ($eventName=null) | |
Removes all listeners. More... | |
Data Fields | |
$xml | |
$propertyMap = [] | |
const | AUTH_BASIC = 1 |
Basic authentication. More... | |
const | AUTH_DIGEST = 2 |
Digest authentication. More... | |
const | AUTH_NTLM = 4 |
NTLM authentication. More... | |
const | ENCODING_IDENTITY = 1 |
Identity encoding, which basically does not nothing. More... | |
const | ENCODING_DEFLATE = 2 |
Deflate encoding. More... | |
const | ENCODING_GZIP = 4 |
Gzip encoding. More... | |
const | ENCODING_ALL = 7 |
Sends all encoding headers. More... | |
Data Fields inherited from Sabre\HTTP\Client | |
const | STATUS_SUCCESS = 0 |
const | STATUS_CURLERROR = 1 |
const | STATUS_HTTPERROR = 2 |
Protected Attributes | |
$baseUri | |
$encoding = self::ENCODING_IDENTITY | |
Protected Attributes inherited from Sabre\HTTP\Client | |
$curlSettings = [] | |
$throwExceptions = false | |
$maxRedirects = 5 | |
Additional Inherited Members | |
Protected Member Functions inherited from Sabre\HTTP\Client | |
doRequest (RequestInterface $request) | |
This method is responsible for performing a single request. More... | |
createCurlSettingsArray (RequestInterface $request) | |
Turns a RequestInterface object into an array with settings that can be fed to curl_setopt. More... | |
parseCurlResult ($response, $curlHandle) | |
Parses the result of a curl call in a format that's a bit more convenient to work with. More... | |
sendAsyncInternal (RequestInterface $request, callable $success, callable $error, $retryCount=0) | |
Sends an asynchronous HTTP request. More... | |
curlExec ($curlHandle) | |
Calls curl_exec. More... | |
curlStuff ($curlHandle) | |
Returns a bunch of information about a curl request. More... | |
SabreDAV DAV client.
This client wraps around Curl to provide a convenient API to a WebDAV server.
NOTE: This class is experimental, it's api will likely change in the future.
Definition at line 20 of file Client.php.
Sabre\DAV\Client::__construct | ( | array | $settings | ) |
Constructor.
Settings are provided through the 'settings' argument. The following settings are supported:
authType must be a bitmap, using self::AUTH_BASIC, self::AUTH_DIGEST and self::AUTH_NTLM. If you know which authentication method will be used, it's recommended to set it, as it will save a great deal of requests to 'discover' this information.
Encoding is a bitmap with one of the ENCODING constants.
array | $settings |
Definition at line 115 of file Client.php.
References Sabre\DAV\Client\$encoding, $password, Sabre\HTTP\Client\addCurlSetting(), and Sabre\DAV\Version\VERSION.
Sabre\DAV\Client::getAbsoluteUrl | ( | $url | ) |
Returns the full url based on the given url (which may be relative).
All urls are expanded based on the base url as given by the server.
string | $url |
Definition at line 389 of file Client.php.
References $url, and Sabre\Uri\resolve().
Referenced by Sabre\DAV\Client\options(), Sabre\DAV\Client\propFind(), Sabre\DAV\Client\propPatch(), and Sabre\DAV\Client\request().
Sabre\DAV\Client::options | ( | ) |
Performs an HTTP options request.
This method returns all the features from the 'DAV:' header as an array. If there was no DAV header, or no contents this method will return an empty array.
Definition at line 322 of file Client.php.
References $request, $response, Sabre\DAV\Client\getAbsoluteUrl(), and Sabre\HTTP\Client\send().
Sabre\DAV\Client::parseMultiStatus | ( | $body | ) |
Parses a WebDAV multistatus response body.
This method returns an array with the following structure
[ 'url/to/resource' => [ '200' => [ '{DAV:}property1' => 'value1', '{DAV:}property2' => 'value2', ], '404' => [ '{DAV:}property1' => null, '{DAV:}property2' => null, ], ], 'url/to/resource2' => [ .. etc .. ] ]
string | $body | xml body |
Definition at line 423 of file Client.php.
References $response, and $result.
Referenced by Sabre\DAV\Client\propFind(), and Sabre\DAV\Client\propPatch().
Sabre\DAV\Client::propFind | ( | $url, | |
array | $properties, | ||
$depth = 0 |
|||
) |
Does a PROPFIND request.
The list of requested properties must be specified as an array, in clark notation.
The returned array will contain a list of filenames as keys, and properties as values.
The properties array will contain the list of properties. Only properties that are actually returned from the server (without error) will be returned, anything else is discarded.
Depth should be either 0 or 1. A depth of 1 will cause a request to be made to the server to also return all child resources.
string | $url | |
array | $properties | |
int | $depth |
Definition at line 198 of file Client.php.
References $namespace, $request, $response, $result, $root, $url, Sabre\DAV\Client\getAbsoluteUrl(), Sabre\Xml\Service\parseClarkNotation(), Sabre\DAV\Client\parseMultiStatus(), and Sabre\HTTP\Client\send().
Sabre\DAV\Client::propPatch | ( | $url, | |
array | $properties | ||
) |
Updates a list of properties on the server.
The list of properties must have clark-notation properties for the keys, and the actual (string) value for the value. If the value is null, an attempt is made to delete the property.
string | $url | |
array | $properties |
Definition at line 268 of file Client.php.
References $request, $response, $result, $url, Sabre\DAV\Client\$xml, Sabre\DAV\Client\getAbsoluteUrl(), Sabre\DAV\Client\parseMultiStatus(), and Sabre\HTTP\Client\send().
Sabre\DAV\Client::request | ( | $method, | |
$url = '' , |
|||
$body = null , |
|||
array | $headers = [] |
||
) |
Performs an actual HTTP request, and returns the result.
If the specified url is relative, it will be expanded based on the base url.
The returned array contains 3 keys:
For large uploads, it's highly recommended to specify body as a stream resource. You can easily do this by simply passing the result of fopen(..., 'r').
This method will throw an exception if an HTTP error was received. Any HTTP status code above 399 is considered an error.
Note that it is no longer recommended to use this method, use the send() method instead.
string | $method | |
string | $url | |
string | resource | null | $body | |
array | $headers |
ClientException,in | case a curl error occurred. |
Definition at line 369 of file Client.php.
References $response, $url, Sabre\DAV\Client\getAbsoluteUrl(), and Sabre\HTTP\Client\send().
Referenced by Sabre\DAV\ClientMock\doRequest().
|
protected |
Definition at line 49 of file Client.php.
|
protected |
Definition at line 91 of file Client.php.
Referenced by Sabre\DAV\Client\__construct().
Sabre\DAV\Client::$propertyMap = [] |
Definition at line 40 of file Client.php.
Sabre\DAV\Client::$xml |
Definition at line 29 of file Client.php.
Referenced by Sabre\DAV\Client\propPatch().
const Sabre\DAV\Client::AUTH_BASIC = 1 |
Basic authentication.
Definition at line 54 of file Client.php.
Referenced by Sabre\DAV\ClientTest\testBasicAuth().
const Sabre\DAV\Client::AUTH_DIGEST = 2 |
Digest authentication.
Definition at line 59 of file Client.php.
Referenced by Sabre\DAV\ClientTest\testDigestAuth().
const Sabre\DAV\Client::AUTH_NTLM = 4 |
NTLM authentication.
Definition at line 64 of file Client.php.
Referenced by Sabre\DAV\ClientTest\testNTLMAuth().
const Sabre\DAV\Client::ENCODING_ALL = 7 |
Sends all encoding headers.
Definition at line 84 of file Client.php.
const Sabre\DAV\Client::ENCODING_DEFLATE = 2 |
Deflate encoding.
Definition at line 74 of file Client.php.
Referenced by Sabre\DAV\ClientTest\testEncoding().
const Sabre\DAV\Client::ENCODING_GZIP = 4 |
Gzip encoding.
Definition at line 79 of file Client.php.
Referenced by Sabre\DAV\ClientTest\testEncoding().
const Sabre\DAV\Client::ENCODING_IDENTITY = 1 |
Identity encoding, which basically does not nothing.
Definition at line 69 of file Client.php.
Referenced by Sabre\DAV\ClientTest\testEncoding().