Re: Virtual Filesystem
| From: | Alan Knowles | Date: | Thu, 26 Sep 2002 09:28:49 +0000 |
| Subject: | Re: Virtual Filesystem | ||
| References: | 1 2 3 4 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-9530@lists.php.net to get a copy of this message | ||
Im not sure what the direction of this is now - Jon are you still looking at creating a new System_VFS?
mainly cause after alot of prototyping, implementing a vfs backend for webdav turned out to be the simplest solution here (rather than trying to get clever and pointing webdav directly at dataobjects)...
anyway - this is the roughtly API, I got so far, although I'm still working through the issues with it..
class System_VFS extends PEAR {
// returns vfs object or pear error..
function factory($url) {
$purl = parse_url($url);
//require_once "System/VFS/{$purl['scheme']}.php";
$class = "System_VFS_{$purl['scheme']}";
$child = new $class;
$ret = $child->factory($purl['path']);
//print_r($purl);
// print_r($ret);
return $ret;
}
function isDir() { } // true | false
function isFile() { }// true | false
function getName() { } //string
function getPath() { }// string
function getSize() { }// int
function getRevised() { }// anything that the Date Class can read
function getCreated() { }// anything that the Date Class can read
function canModify() { }// true | false
function canDelete() { } // true | false
function serve() { } // echos contents of file.
function opendir() { }// none or PEAR:error,
// (prepares a directory for reading - in some cases reads it into a local arrayfunction readdir() { } // returns false or another vfsobject /* experimenal */ function updateFrom($vfsobject) { } // copies data from one object to another.. function copyTo($vfsdir) { } // copys vfs object to a vfs folder. return none or PEAR::error function moveTo($vfsdir) { }/ moves vfs object to another vfs folder.return none or PEAR::error function createFile($name) { } // create a file in a folder (eg. touch it!) returns vfsobject or PEAR::error function createDir($name) { } // create a folder returns vfsobject or PEAR::error function delete() { } // deletes the current vfs file/folder etc. // return none or pearError function write($data) { } // write $data to vfs object.. } Regards Alan Jon Wood wrote:
I put mine in System - I dunno about making a Horde branch, since I thought that the branches were meant to represent the purpose of the class, and considering the range of what the Horde project does, I doubt that you can sum up the purpose of every class in there with the name Horde. Jon ----- Original Message ----- From: "Chuck Hagenbuch" <chuck@horde.org> To: <pear-dev@lists.php.net> Sent: Tuesday, September 24, 2002 10:32 PM Subject: Re: [PEAR-DEV] Virtual FilesystemQuoting Pierre-Alain Joye <paj@pearfr.org>:consistentbtw, I like to see it under File, not under the root, or ? (well, *virtual* file, but ;)) )I'm not set on it going in the root, but File might be confusing; you'd expect other File_* classes to work with it, then, but everything else in File/ is filesystem based... I was actually thinking of pushing for it to go inside a Horde/ subdirectory, to avoid clashes with other files and to give us anamespace in which to release our other classes as PEAR-installablecomponents.-chuck -- Charles Hagenbuch, <chuck@horde.org> "After a few minutes the most aromatic and nice smelling Italian coffee will come out of the exhaustpipe." - Our stove-top espresso pot -- PEAR Development Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php