You must explicitly enable the VFS class. To do this, set "enable_vfs_class" to True in $phpgw_info["flags"]. An example:
$phpgw_info["flags"] = array("currentapp" => "phpwebhosting", "noheader" => False, "noappheader" => False, "enable_vfs_class" => True, "enable_browser_class" => True);
The VFS in located in phpgwapi/inc/class.vfs.inc.php. You can look over it, but I don't suggest trying to understand how it works. It isn't necessary to know its internals to use it, but you may find the inline comments helpful. The basic things to keep in mind:
$phpgw->vfs->mv ("file1", "dir/file2"); $phpgw->vfs->mv ("dir1", "dir/dir1"); $phpgw->vfs->rm ("file"); $phpgw->vfs->rm ("dir");
All work as you would except them to. The major exception is:
$phpgw->vfs->touch ("file");
vs.
$phpgw->vfs->mkdir ("dir");
As far as the actual paths are concerned, users and groups are the same. The VFS has no built in ACL support, so /home/username works the same as /home/groupname. See the note on AC L support in the Notes section.
One of the VFS's responsibilities is to translate paths for you. While you certainly can operate using full paths, it is much simpler to use the virtual paths. For example, instead of using:
$phpgw->vfs->cp ("/var/www/phpgroupware/files/home/user/file1", "/var/www/phpgroupware/files/home/user/file2", array (RELATIVE_NONE|VFS_REAL, RELATIVE_NONE|VFS_REAL));
you might use
$phpgw->vfs->cp ("/home/user/file1", "/home/user/file2", array (RELATIVE_NONE, RELATIVE_NONE));
(We'll get to the RELATIVE's in a minute.)
Site administrators should be able to move their files dir around on their system and know that everything will continue to work smoothly.
Relativity is a new feature in the VFS, and its importance cannot be stressed enough. It will make your life much easier, especially for file system intensive applications, but it will take some getting used to. If something doesn't work right the first time, chances are great it has to do with incorrect relativity settings. We will deal with relativity in depth in the Relativity section.