Ejemplo n.º 1
0
 /**
  * Сохраняет конфигурацию серверов.
  *
  * @param array $wdcs_prms конфигурация серверов WebDAV (см. конструктор)
  */
 public function setWdcParams($wdcs_prms)
 {
     foreach ($wdcs_prms as $wdid => $prms) {
         if (($owdc = $this->_wdcs[$wdid]) && $owdc->connected) {
             $owdc->close();
         }
         $this->_wdcs[$wdid] = $wdc = new webdav_client();
         $wdc->set_server($prms['server']);
         $wdc->set_port($prms['port']);
         $wdc->set_user($prms['user']);
         $wdc->set_pass($prms['pass']);
         $wdc->set_protocol((int) $prms['protocol']);
         // use HTTP/1.0 - 1.1 работает с глюками в портфолио и медленнее
         $wdc->set_debug($prms['debug']);
         $wdc->prefix = $prms['prefix'];
         $wdc->prefix_local = 'http://' . $prms['server'] . ':' . $prms['port'];
         // тут пока только "http".
         $wdc->is_reserved = $prms['is_reserved'];
     }
 }
Ejemplo n.º 2
0
<body>
<?php 
/*
$Id: test.php,v 1.4 2004/08/18 14:11:04 chris Exp $
$Author: chris $
$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('/');
?>
Ejemplo n.º 3
0
error_reporting( 0 );

//error_reporting( -1 );
//ini_set("display_errors", 1);

if ( !class_exists( 'webdav_client' ) )
{
    require('class_webdav_client.php');
}

$wdc = new webdav_client();
$wdc->set_server( 'ssl://webdav.yandex.ru' );
$wdc->set_port( 443 );
$wdc->set_user( 'forpdfsending' );
$wdc->set_pass( '' );
// use HTTP/1.1
$wdc->set_protocol( 1 );
// enable debugging
$wdc->set_debug( false );


if ( !$wdc->open() )
{
    print 'Error: could not open server connection <br /> \r\n';
    exit;
}

// check if server supports webdav rfc 2518
if ( !$wdc->check_webdav() )
{
Ejemplo n.º 4
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;
 }