|
Moodle
2.2.1
http://www.collinsharper.com
|
Public Member Functions | |
| __construct ($server= '', $user= '', $pass= '', $auth=false) | |
| __set ($key, $value) | |
| set_protocol ($version) | |
| iso8601totime ($iso8601) | |
| open () | |
| close () | |
| check_webdav () | |
| options () | |
| mkcol ($path) | |
| get ($path, &$buffer) | |
| put ($path, $data) | |
| put_file ($path, $filename) | |
| get_file ($srcpath, $localpath) | |
| copy_file ($src_path, $dst_path, $overwrite) | |
| copy_coll ($src_path, $dst_path, $overwrite) | |
| move ($src_path, $dst_path, $overwrite) | |
| lock ($path) | |
| unlock ($path, $locktoken) | |
| delete ($path) | |
| ls ($path) | |
| gpi ($path) | |
| is_file ($path) | |
| is_dir ($path) | |
| mput ($filelist) | |
| mget ($filelist) | |
Definition at line 36 of file webdavlib.php.
| __construct | ( | $ | server = '', |
| $ | user = '', |
||
| $ | pass = '', |
||
| $ | auth = false |
||
| ) |
#@- Constructor - Initialise class variables
Definition at line 82 of file webdavlib.php.
| __set | ( | $ | key, |
| $ | value | ||
| ) |
Definition at line 92 of file webdavlib.php.
| check_webdav | ( | ) |
Check's if server is a webdav compliant server. True if server returns a DAV Element in Header and when schema 1,2 is supported.
Definition at line 185 of file webdavlib.php.

| close | ( | ) |
Closes an open socket.
Definition at line 173 of file webdavlib.php.
| copy_coll | ( | $ | src_path, |
| $ | dst_path, | ||
| $ | overwrite | ||
| ) |
Public method copy_coll
Copies a collection on a webdav server
Duplicates a collection on the webdav server (serverside). All work is done on the webdav server. If you set param overwrite as true, the target will be overwritten.
| string | src_path, string dest_path, bool overwrite |
Definition at line 467 of file webdavlib.php.
| copy_file | ( | $ | src_path, |
| $ | dst_path, | ||
| $ | overwrite | ||
| ) |
Public method copy_file
Copies a file on a webdav server
Duplicates a file on the webdav server (serverside). All work is done on the webdav server. If you set param overwrite as true, the target will be overwritten.
| string | src_path, string dest_path, bool overwrite |
Definition at line 419 of file webdavlib.php.
| delete | ( | $ | path | ) |
Public method delete
deletes a collection/directory on a webdav server
| string | path |
Definition at line 687 of file webdavlib.php.
| get | ( | $ | path, |
| &$ | buffer | ||
| ) |
Public method get
Gets a file from a webdav collection.
| string | path, string &buffer |
Definition at line 265 of file webdavlib.php.
| get_file | ( | $ | srcpath, |
| $ | localpath | ||
| ) |
Public method get_file
Gets a file from a collection into local filesystem.
fopen() is used.
| string | srcpath, string localpath |
Definition at line 387 of file webdavlib.php.

| gpi | ( | $ | path | ) |
Public method gpi
Get's path information from webdav server for one element.
| string | path |
Definition at line 848 of file webdavlib.php.


| is_dir | ( | $ | path | ) |
Public method is_dir
Gather whether a path points to a directory
| string | path return bool true or false |
Definition at line 898 of file webdavlib.php.


| is_file | ( | $ | path | ) |
Public method is_file
Gathers whether a path points to a file or not.
| string | path |
Definition at line 880 of file webdavlib.php.


| iso8601totime | ( | $ | iso8601 | ) |
Convert ISO 8601 Date and Time Profile used in RFC 2518 to an unix timestamp. private
| string | iso8601 |
Definition at line 117 of file webdavlib.php.
| lock | ( | $ | path | ) |
Public method lock
Locks a file or collection.
Lock uses this->_user as lock owner.
| string | path |
Definition at line 576 of file webdavlib.php.
| ls | ( | $ | path | ) |
Public method ls
Get's directory information from webdav server into flat a array using PROPFIND
All filenames are UTF-8 encoded. Have a look at _propfind_startElement what keys are used in array returned.
| string | path |
Definition at line 760 of file webdavlib.php.

| mget | ( | $ | filelist | ) |
Public method mget
Gets multiple files and directories.
FileList must be in format array("remotepath" => "localpath"). Filenames are UTF-8 encoded.
| array | filelist |
Definition at line 976 of file webdavlib.php.

| mkcol | ( | $ | path | ) |
Public method mkcol
Creates a new collection/directory on a webdav server
| string | path |
seems to be http ... proceed just return what server gave us rfc 2518 says: 201 (Created) - The collection or structured resource was created in its entirety. 403 (Forbidden) - This indicates at least one of two conditions: 1) the server does not allow the creation of collections at the given location in its namespace, or 2) the parent collection of the Request-URI exists but cannot accept members. 405 (Method Not Allowed) - MKCOL can only be executed on a deleted/non-existent resource. 409 (Conflict) - A collection cannot be made at the Request-URI until one or more intermediate collections have been created. 415 (Unsupported Media Type)- The server does not support the request type of the body. 507 (Insufficient Storage) - The resource does not have sufficient space to record the state of the resource after the execution of this method.
Definition at line 228 of file webdavlib.php.

| move | ( | $ | src_path, |
| $ | dst_path, | ||
| $ | overwrite | ||
| ) |
Public method move
Moves a file or collection on webdav server (serverside)
If you set param overwrite as true, the target will be overwritten.
| string | src_path, string dest_path, bool overwrite |
Definition at line 521 of file webdavlib.php.
| mput | ( | $ | filelist | ) |
Public method mput
Puts multiple files and/or directories onto a webdav server.
Filenames should be allready UTF-8 encoded. Param fileList must be in format array("localpath" => "destpath").
| array | filelist |
Definition at line 922 of file webdavlib.php.

| open | ( | ) |
Open's a socket to a webdav server
Definition at line 154 of file webdavlib.php.
| options | ( | ) |
Get options from webdav server.
Definition at line 204 of file webdavlib.php.

| put | ( | $ | path, |
| $ | data | ||
| ) |
Public method put
Puts a file into a collection. Data is putted as one chunk!
| string | path, string data |
Definition at line 297 of file webdavlib.php.
| put_file | ( | $ | path, |
| $ | filename | ||
| ) |
Public method put_file
Read a file as stream and puts it chunk by chunk into webdav server collection.
Look at php documenation for legal filenames with fopen(); The filename will be translated into utf-8 if not allready in utf-8.
| string | targetpath, string filename |
Definition at line 336 of file webdavlib.php.

| set_protocol | ( | $ | version | ) |
Set which HTTP protocol will be used. Value 1 defines that HTTP/1.1 should be used (Keeps Connection to webdav server alive). Otherwise HTTP/1.0 will be used.
| int | version |
Definition at line 103 of file webdavlib.php.
| unlock | ( | $ | path, |
| $ | locktoken | ||
| ) |
Public method unlock
Unlocks a file or collection.
| string | path, string locktoken |
Definition at line 661 of file webdavlib.php.