Friday, June 8, 2007

How to Install a WebDAV Server in PHP

How to install a webdav server in PHP

It's very simple.

  • Download this package, and decompress it.
  • The inc folder contains PEAR and the HTTP_WebDAV_Server class.
  • Copy the inc folder and authenticate.php file in the include_path (see php.ini)
  • Copy webdav.php file in the root of your site.

The authenticate.php file contains a digest authentification.

The webdav.php file create a webdav server


include_once("authenticate.php");

ini_set("error_reporting", "");

# Name of your restricted area
$realm = 'Restricted area Keyphrene';
$DBUSER = "your login";
$DBPWD = "your password";
$users = array($DBUSER => $DBPWD);
# With this authentication method,
# your password is not readable when you use this service
AuthenticationDigestHTTP($realm, $users);
# AuthenticationBasicHTTP($realm, $users);

require_once "HTTP/WebDAV/Server/Filesystem.php";
$server = new HTTP_WebDAV_Server_Filesystem();
# Database configuration for the lock method
$server->db_host = $DBHOST;
$server->db_name = $DB_WEBDAV;
$server->db_user = $DBUSER;
$server->db_passwd = $DBPWD;
# Real path of your site
$server->ServeRequest($DOCUMENT_ROOT."/www/");

?>

To use this service, you must connect you at this adress http://mysite.org/webdav.php. You can configure a lot of access on your site. Becareful, if you must copy files on your server, you must use the good permissions with the FTP client.

Thursday, June 7, 2007

LIBNAME Statement Support for WebDAV Servers

   LIBNAME statement support for WebDAV servers will be available for use
in SAS® 9.1.3 (9.1 TS1M3) with hot fix D9BA08, which is currently
under production.

The LIBNAME statement is being extended to allow access to content
stored in a Web Distributed Authoring and Versioning (WebDAV) server.

Syntax

LIBNAME libref 'SAS-library' WEBDAV USER="user-ID"
PASSWORD="user-password";

Where 'SAS-library' specifies the URL location (path) on a WebDAV
server. The URL specifies either HTTP or HTTPS communication protocols.

Only one data library is supported when using the WebDAV extension to
libnames. REMOTE engines are not supported with the WebDAV options.


WebDAV Specific Options

WEBDAV
specifies that the libref accesses a WebDAV server.

USER="user-ID"
specifies the user name for access to the WebDAV server. The user-ID is
case-sensitive, so it must be in single or double quotes.
Alias: UID

PASSWORD="user-password"
specifies a password for the user to access the WebDAV server. The
user-password is case-sensitive, so it must be in single or double
quotes.
Alias: PWD=, PW=, PASS=


Data Set Options

The following table lists the data set options that have different
functionality when using a WebDAV server. All other data set options
will function as described in the SAS Language: Reference.

Data Set Option Functionality with WebDAV

Data Set Option WebDAV Storage Functionality

CNTLLEV= LIB locks all data sets in the library prior to writing
the data into the local cache. All members are unlocked
once the data step has completed and the data set has
been written back to the WebDAV server.

MEM locks the member prior to writing the data into the
local cache. Member is unlocked once the data step has
completed and the data has been written back to the
WebDAV server.

REC is not supported. WebDAV will only allow updates to
the entire data set.

FILECLOSE VxTAPE engine is not supported, therefore this option
is ignored.

GENMAX= This functionality is not supported because the maximum
number of revisions to keep cannot be specified in
WebDAV.

GENNUM= If present, the specific version specified isnot
retrieved from the WebDAV server for read-only access.

IDXNAME= Users can specify an index to use if one exists.
However, to use this option, you need to
have accessed the data set (to get it locally) then
created an index so that it would be available.

INDEX= Indexes may be created in the local cache and used in
subsequent DATA steps.

TOBSNO= Remote engines are not supported, so this option
is not needed.


Details

When accessing a WebDAV server, the file is pulled from the WebDAV
server to your local disk storage for processing. When you complete the
updating, the file is pushed back to the WebDAV server for storage. The
file is removed from the local disk storage when it is pushed back.

Example

The following example associates the libref davdata with the WebDAV
directory /users/mydir/datadir on the WebDAV server www.webserver.com:

libname davdata v9 "https://www.webserver.com/users/mydir/datadir"
webdav user="mydir" pw="12345";


A fix for SAS 9.1.3 (9.1 TS1M3) for this issue is available at:

http://www.sas.com/techsup/download/hotfix/e9_sbcs_prod_list.html#013763

For customers running SAS with Asian Language Support (DBCS), this
fix should be downloaded from:

http://www.sas.com/techsup/download/hotfix/e9_dbcs_prod_list.html#013763
Anton Subagja