Beispiel #1
0
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...
<?php 
$test_folder = '/wdc test 1 folder';
print '<br>creating collection ' . $test_folder . ' ...<br>';
$http_status = $wdc->mkcol($test_folder);
print 'webdav server returns ' . $http_status . '<br>';
print 'removing collection just created using method webdav_client::delete ...<br>';
$http_status_array = $wdc->delete($test_folder);
print 'webdav server returns ' . $http_status_array['status'] . '<br>';
print 'let\'s see what\'s happening when we try to delete the same nonexistent collection again....<br>';
$http_status_array = $wdc->delete($test_folder);
print 'webdav server returns ' . $http_status_array['status'] . '<br>';
print 'let\'s see what\'s happening when we try to delete an existent locked collection....<br>';
$http_status_array = $wdc->delete('/packages.txt');
print 'webdav server returns ' . $http_status_array['status'] . '<br>';
$test_folder = '/wdc test 2 folder';
print 'let\'s create a second collection ...' . $test_folder . '<br>';
$http_status = $wdc->mkcol($test_folder);
print 'webdav server returns ' . $http_status . '<br>';
// put a file to webdav collection
$filename = './Testfiles/test_ref.rar';
print 'Let\'s put the file ' . $filename . ' using webdav::put into collection...<br>';
$handle = fopen($filename, 'r');