Ejemplo n.º 1
0
 /**
  * Подключает клиента к серверу.
  *
  * @param webdav_client $wdc   объект клиента
  * @return boolean   успешно?
  */
 private function _connect($wdc)
 {
     if (!$wdc->connected) {
         if (!($wdc->connected = $wdc->open())) {
             $this->_log->writeln("error {$rc}: could not open server connection: {$wdc->_server}");
         }
     }
     return $wdc->connected;
 }
Ejemplo n.º 2
0
$Date: 2004/08/18 14:11:04 $
$Revision: 1.4 $
*/
if (!class_exists('webdav_client')) {
    require './Yandex.Disk_client.php';
}
$wdc = new webdav_client();
$wdc->set_server('ssl://webdav.yandex.ru');
$wdc->set_port(443);
$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 
Ejemplo n.º 3
0
 function &get_webdav_client($user, $pass)
 {
     $client = new webdav_client();
     $client->set_server($this->server);
     $client->set_port($this->port);
     $client->set_user($user);
     $client->set_pass($pass);
     $client->open();
     return $client;
 }