becklyn / webdav
Lightweight WebDav client
1.1.0
2021-08-20 13:47 UTC
Requires
- php: >=8.0
- sabre/dav: ^4.1
Requires (Dev)
- phpspec/prophecy-phpunit: ^2.0
- phpunit/phpunit: ^9.5
README
A simple WebDav client.
Installation
$ composer require becklyn/webdav
Usage
$client = new \Becklyn\WebDav\Client(new \Becklyn\WebDav\Config(
'base_url',
'username',
'password'
));
$files = $client->listFolderContents('path/to/folder');
foreach ($files as $file) {
if ($file instanceof \Becklyn\WebDav\Resource\File) {
file_put_contents("/tmp/{$file->path()}", $client->getFileContents($file));
}
}