becklyn/webdav

Lightweight WebDav client

1.1.0 2021-08-20 13:47 UTC

This package is auto-updated.

Last update: 2024-12-20 21:14:56 UTC


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));    
    }
}