becklyn/webdav

Lightweight WebDav client

1.1.0 2021-08-20 13:47 UTC

This package is auto-updated.

Last update: 2024-11-20 21:02:50 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));    
    }
}