Ejemplo n.º 1
0
$wdc->set_user('user');
$wdc->set_pass('password');
// use HTTP/1.1
$wdc->set_protocol(1);
// enable debugging
$wdc->set_debug(false);
if (!$wdc->open()) {
    print 'Error: could not open server connection';
    exit;
}
// check if server supports webdav rfc 2518
if (!$wdc->check_webdav()) {
    print 'Error: server does not support webdav or user/password may be wrong';
    exit;
}
$dir = $wdc->ls('/');
?>
<h1>class_webdav_client Test-Suite:</h1><p>
Using method webdav_client::ls to get a listing of dir /:<br>
<table summary="ls" border="1">
<th>Filename</th><th>Size</th><th>Creationdate</th><th>Resource Type</th><th>Content Type</th><th>Activelock Depth</th><th>Activelock Owner</th><th>Activelock Token</th><th>Activelock Type</th>
<?php 
foreach ($dir as $e) {
    $ts = $wdc->iso8601totime($e['creationdate']);
    $line = sprintf('<tr><td>%s&nbsp;</td><td>%s&nbsp;</td><td>%s&nbsp;</td><td>%s&nbsp;</td><td>%s&nbsp;</td><td>%s&nbsp;</td><td>%s&nbsp;</td><td>%s&nbsp;</td><td>%s&nbsp;</td></tr>', $e['href'], $e['getcontentlength'], date('d.m.Y H:i:s', $ts), $e['resourcetype'], $e['getcontenttype'], $e['activelock_depth'], $e['activelock_owner'], $e['activelock_token'], $e['activelock_type']);
    print urldecode($line);
}
?>
</table>
<p>
Create a new collection (Directory) using method webdav_client::mkcol...