Property | Type | Description | |
---|---|---|---|
$createDirectoriesAutomatically | boolean | If disabled, commands will throw an error if target directory doesn't exist. | |
$logger | Jyxo\Webdav\LoggerInterface | Logger. | |
$parallelSending | boolean | If parallel request sending is enabled. | |
$requestOptions | array | Request options. | |
$servers | array | Servers list. |
Method | Description | |
---|---|---|
__construct ( array $servers ) | Constructor. | |
copy ( string $pathFrom, string $pathTo ) | Copies a file. | |
exists ( string $path ) : boolean | Checks if a file exists. | |
get ( string $path ) : string | Returns file contents. | |
getProperty ( string $path, string $property = null ) : mixed | Returns a file property. | |
isDir ( string $dir ) : boolean | Checks if a directory exists. | |
mkdir ( string $dir, boolean $recursive = true ) | Creates a directory. | |
put ( string $path, string $data ) | Saves data to a remote file. | |
putFile ( string $path, string $file ) | Saves file contents to a remote file. | |
rename ( string $pathFrom, string $pathTo ) | Renames a file. | |
rmdir ( string $dir ) | Deletes a directory. | |
setCreateDirectoriesAutomatically ( boolean $createDirectoriesAutomatically ) : self | Enables/disables automatic creation of target directories. | |
setLogger ( Jyxo\Webdav\LoggerInterface $logger ) : self | Sets a logger. | |
setParallelSending ( boolean $parallelSending ) : self | Enables/disables parallel request sending. | |
setRequestOption ( string $name, mixed $value ) : self | Sets a request option. | |
unlink ( string $path ) | Deletes a file. |
Method | Description | |
---|---|---|
createAllRequests ( string $path, string $method, array $headers = [], string | resource | null $body = null ) : array | Creates a list of requests; one for each server. | |
createClient ( ) : |
||
createRequest ( string $server, string $path, string $method, array $headers = [], string | resource | null $body = null ) : GuzzleHttp\Psr7\Request | Creates a request. | |
getDirPath ( string $path ) : string | Creates a directory path with the trailing slash. | |
getFilePath ( string $path ) : string | Creates a file path without the trailing slash. | |
getProperties ( |
Fetches properties from the response. | |
getRandomServer ( ) : string | ||
processPut ( string $path, string $data, boolean $isFile ) | Processes a PUT request. | |
sendAllRequests ( array $requests ) : array | Sends requests to all servers. | |
sendRequest ( string $path, string $method, array $headers = [] ) : |
Sends a request. |
protected createRequest ( string $server, string $path, string $method, array $headers = [], string | resource | null $body = null ) : GuzzleHttp\Psr7\Request | ||
$server | string | Server |
$path | string | Path |
$method | string | Request method |
$headers | array | Array of headers |
$body | string | resource | null | Request body |
return | GuzzleHttp\Psr7\Request |
protected getDirPath ( string $path ) : string | ||
$path | string | Directory path |
return | string |
protected getFilePath ( string $path ) : string | ||
$path | string | File path |
return | string |
protected getProperties ( |
||
$response | Response | |
return | array |
protected sendAllRequests ( array $requests ) : array | ||
$requests | array | Request list |
return | array |
public setCreateDirectoriesAutomatically ( boolean $createDirectoriesAutomatically ) : self | ||
$createDirectoriesAutomatically | boolean | |
return | self |
public setLogger ( Jyxo\Webdav\LoggerInterface $logger ) : self | ||
$logger | Jyxo\Webdav\LoggerInterface | Logger |
return | self |
public setParallelSending ( boolean $parallelSending ) : self | ||
$parallelSending | boolean | |
return | self |
public setRequestOption ( string $name, mixed $value ) : self | ||
$name | string | Option name |
$value | mixed | Option value |
return | self |
protected bool $createDirectoriesAutomatically | ||
return | boolean |
protected LoggerInterface,Jyxo\Webdav $logger | ||
return | Jyxo\Webdav\LoggerInterface |
protected bool $parallelSending | ||
return | boolean |