/** * Сохраняет конфигурацию серверов. * * @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']; } }
/* $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('/'); ?> <h1>class_webdav_client Test-Suite:</h1><p> Using method webdav_client::ls to get a listing of dir /:<br>