Re: Virtual Filesystem
| From: | Wolfram Kriesing | Date: | Thu, 26 Sep 2002 20:33:44 +0000 |
| Subject: | Re: Virtual Filesystem | ||
| References: | 1 2 3 4 5 6 7 8 9 10 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-9570@lists.php.net to get a copy of this message | ||
Chuck Hagenbuch wrote:
Quoting Wolfram Kriesing <lists@kriesing.de>:as i said, i was only roughly looking thru the VFS code. i dont really know what a VFS has to do with a tree in the first place, the only thing i can guess is the directory structure, right? as i said i only saw the 'folder' and 'children' stuff in there. so i thought u might think the tree class is helpful. just an (not working code) example, may be u can figure out if it makes sense to use it. it was just a thought! $tree = new Tree('FileSystem','/home/cain') // get the id for the root dir '/home/cain' // the tree class works with ids $rootId = $tree->getRootId(); $newFolderId = $tree->add('pear',$rootId); // create some folders under '/home/cain/pear' $tree->add('HTTP',$newFolderId); $tree->add('Net',$newFolderId); $tree->add('DB',$newFolderId); $id = $tree->add('aaahm',$newFolderId); // move the directory 'aaahm' in the root $tree->move($id,$rootId); // actually its not really needed $tree->remove($id); all the code up there does is create a tree structure on a file system, under the given root folder now you can apply exactly the same thing on a DB, Arrays just initialize it $tree = new Tree('Array',$myArray) // on a nested DB-structure $tree = new Tree('DBNested','mysql://root@localhost/tree') from XML files you can currently only read, since i was looking for a locking mechanism ... but it will come :-) that would be $tree = new Tree('XML','/home/cain/config.xml') -- Wolfram ... translating template engine .... http://sf.net/projects/simpletpl ... authentication system .... http://sf.net/projects/authi saw that the VFS also works on sql, i was just having a short look, but do you think it makes sense basing some of the stuff on the tree-class? since i saw that the VFS saves something like folders and a tree structure i thought that the tree-clas might be useful there? or is it not useful here at all?What would you base on the tree class? I'm having a hard time imagining what would work that way...