Categorized | News

Tags | , ,

PEAR::Tree Tutorial

Posted on 27 April 2003 by Demian Turner

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.

Bookmark and Share

9 Comments For This Post

  1. manoj Says:

    Unable to pass the database into it.

    Plz Hlp.

    Getting Err…

    DB Error: connect failed

  2. Confluence: Zend Framework Proposals Says:

    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′,…

  3. phero Says:

    Maybe you need to remove the DB::error class so that it stops giving errors.

  4. Neil Says:

    What am I missing? How do I see the full article?

  5. Demian Turner Says:

    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.

  6. MrM Says:

    Where is the ‘read more’ link?

  7. Demian Turner Says:

    @MrM – I’ve updated the article, it seems the docs on the PEAR site have been removed.

  8. Lampe Says:

    I don’t see any ‘Read more’ links at all

  9. Demian Turner Says:

    @Lampe – article updated to be EVEN clearer, the tutorial is no longer available.

1 Trackbacks For This Post

  1. PEAR tutorials | PHP kitchen Says:

    […] […]

Leave a Reply



Demian Turner's currently-reading book recommendations, reviews, favorite quotes, book clubs, book trivia, book lists



PHPkitchen recommends you also check out the following sites :

Accounting for Small Businesses

FreeAgent sign-up