|
SimpleCollection
Quickly setting up static tree structures
Phase-Implementation OverviewThe Sabre_DAV_SimpleCollection class allows you to easily build up static trees in your webdav filesystem. This is very useful if there is a part in your directory tree that's read-only and doesn't often change. Using the SimpleCollection class is very simple, all it takes is a name argument and a set of childnodes. Example
$root = new Sabre_DAV_SimpleCollection('root',array(
new Sabre_DAV_SimpleCollection('users'),
new Sabre_DAV_SimpleCollection('files'),
new Sabre_DAV_SimpleCollection('home')
));
$server = new Sabre_DAV_Server($root);
As you can see, the children argument is optional. The children can be any object implementing Sabre_DAV_INode. Note that since SabreDAV 1.4, you don't have to ever specify a top-level object, as it is automatically created by SabreDAV, if you pass an array to the constructor. Example:
$root = array(
new Sabre_DAV_SimpleCollection('users'),
new Sabre_DAV_SimpleCollection('files'),
new Sabre_DAV_SimpleCollection('home')
);
$server = new Sabre_DAV_Server($root);
| |
► Sign in to add a comment