Skip to content

Instantly share code, notes, and snippets.

@LukasReschke
Created May 4, 2015 13:23
Show Gist options
  • Save LukasReschke/4542cb7f828a72607683 to your computer and use it in GitHub Desktop.
Save LukasReschke/4542cb7f828a72607683 to your computer and use it in GitHub Desktop.
<?php
require_once('./lib/base.php');
use Sabre\DAV\Client;
$settings = [
'baseUri' => 'http://localhost/master/remote.php/webdav/',
'userName' => 'admin',
'password' => 'admin',
'proxy' => 'localhost:8080',
];
$client = new Client($settings);
// Example: PROPFIND files
var_dump($client->propfind('', [], 1));
// Example: Move welcome.txt to bye.txt
$client->request('MOVE', $settings['baseUri'].'/welcome.txt', null, ['Destination' => $settings['baseUri'].'/bye.txt']);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment