Thanks go out to Wolfram Kriesing for having put together the following tutorial for the excellent PEAR::Tree package.
For those of you who don’t know, PEAR::Tree is a package that provides methods to read and manipulate trees, which are stored in the DB or an XML file. The trees can be stored in the DB either as nested trees. Or as simple trees, which use parentId-like structure. Currently XML data can only be read from a file and accessed. The package offers a large number of methods to access and manipulate trees. For example methods like: getRoot, getChild[ren], getParent, getPath and many more.
To get up and running you will need to download the package from the PEAR site. Here are the API docs to get you started.
UPDATE: there are a number of sites linking to this page, I’m afraid a link to the cited tutorial is no longer available as the original author removed it.
November 4th, 2004 at 11:40 am
Unable to pass the database into it.
Plz Hlp.
Getting Err…
DB Error: connect failed
June 5th, 2007 at 9:42 pm
In my day to day work I have 2 use cases when using trees: Work in memory only To build a navigation menu for example , I set up a tree object manually and when I call $tree>addNode(12, new node(array(‘id’=>1, ‘titre’ =>’menu1′,…
December 18th, 2007 at 3:46 pm
Maybe you need to remove the DB::error class so that it stops giving errors.
June 23rd, 2008 at 5:05 pm
What am I missing? How do I see the full article?
June 23rd, 2008 at 5:13 pm
quoting from the last paragraph:
To get up and running you will need to first download the package from the PEAR site then hit ‘read more’ for the full tutorial.
August 6th, 2008 at 8:07 am
Where is the ‘read more’ link?
August 6th, 2008 at 8:22 am
@MrM – I’ve updated the article, it seems the docs on the PEAR site have been removed.
October 28th, 2008 at 1:54 am
I don’t see any ‘Read more’ links at all
October 29th, 2008 at 9:17 pm
@Lampe – article updated to be EVEN clearer, the tutorial is no longer available.