contelli / webdav-sync
1.0.0
2024-12-19 10:59 UTC
Requires
- php: >=8.2
README
A simple library to connect to Nextcloud based webdav ressources
Dependencies
- cURL
- PHP-8.2 or above
- PHP extensions: DOMDocument
Installation
composer require contelli/webdav-sync
composer update
Usage
require_once 'src/WebDav/WebDavClient.php';
use WebDav\WebDav\WebDavClient;
$web_dav_client = new WebDavClient( '', '', '>' );
$web_dav_client->upload_file(dirname(FILE) . '/FILENAME_TO_UPLOAD', '/DIRECTORY_ON_WEBDAV');
$contents = $web_dav_client->read_contents('/DIRECTORY TO READ')); $web_dav_client->delete(REMOTE_FILE_TO_DELETE); $web_dav_client->downloa(REMOTE_FILE_TO_DOWNLOAD, LOCAL_DESTINATION_TO_SAVE);