Home » Structures » Tree
Generic tree management, currently supports databases (via DB, MDB and MDB2) and XML as data sources
This package is unmaintained.
Download latest release 0.3.7 (archived versions might be outdated)
License: PHP License
Description
Provides methods to read and manipulate trees, which are stored in a database (via DB, MDB and MDB2) 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 big number of methods to access and manipulate trees.
For example methods like: getRoot, getChild[ren[Ids]], getParent[s[Ids]], getPath[ById] and many
more.
There are two ways of retreiving the data from the place where they are stored,
one is by reading the entire tree into the memory - the Memory way. The other
is reading the tree nodes as needed (very useful in combination with huge trees
and the nested set model).
The package is designed that way that it is possible to convert/copy tree data
from either structure to another (from XML into DB).
This package has the following drivers:
* DB
* MDB
* MDB2
* Array
* XML
* FileSystem
Maintainers
- Wolfram Kriesing (cain) — lead, inactive
- Helgi Þormar (dufuz) — lead, active
- Daniel Convissor (danielc) — lead, inactive
Dependencies
Required
- PHP (>= 4.3.0)
- PEAR Installer (>= 1.4.0b1)
- PEAR (>= 1.5.4)
Optional
- DB (>= 1.7.11)
- XML_Parser (>= 1.2.8)
Releases
- 0.3.7 (beta, 2012-01-04)
Release notes
License: PHP License
* Fixed mistaken file structure in installed versions of release 0.3.5 and 0.3.6.
- 0.3.6 (beta, 2012-01-04)
Release notes
License: PHP License
* Fixed mistaken file structure in installed versions of release 0.3.5.
- 0.3.5 (beta, 2011-12-10)
Release notes
License: PHP License
* Fixed Bug 19119 Only variable references should be returned by reference.
- 0.3.4 (beta, 2009-03-12)
Release notes
License: PHP License
* Fix Bug #14710: trailing spaces in files [dufuz]
- 0.3.3 (beta, 2008-03-23)
Release notes
License: PHP License
* Fixed Bug #11822 package description should include mention of MDB2 compatibility
* Fixed Bug #11853 Dynamic_MDB2nested uses undefined functions
* Fixed Bug #12780 DB connection instead DSN fails because of get_parent_class
* Fixed Bug #13080 MDB2simple _setup(): parentId cleared if parentId column is mapped to "parentid"
* Fixed Bug #13081 Reopen #11504: MDB2+Tree problem. MDB2 doesn't contains getTextValue method - 0.3.2 (beta, 2007-08-11)
Release notes
License: PHP License
* Fix Bug #11504 MDB2+Tree problem. MDB2 doesn't contains getTextValue method, patch by Simon Ruderich
* Fix Bug #11500 Tree/Memory.php method getElementContent() not working, patch by Simon Ruderich - 0.3.1 (beta, 2007-06-23)
- 0.3.0 (beta, 2007-06-01)
Release notes
License: PHP License
* added parameter to getPathAsString(), which takes the key you want to have in the path
* add method getLevel() to Tree_Common, so it is also available for Dynamic_*, thanks to Michael Johnson
* Fixed bug #1976 Missing $this-> with __construct() (helgi)
* Fixed bug #900 PEAR QA: improvement for get_class()-usage (helgi)
* Fixed Bug #913 MDB Container + fixes (lorzenzo thanks! helgi)
* Fixed Bug #1569 Tree_Memory_DBsimple has no hasChildren function hence remove doesnt work (helgi)
* Fixed Bug #4803 References fix (patch from yunosh aka. Jan Schneider)
* Feature request #6328 add MDB2 and improve MDB usage (lsmith, helgi)
* add unit test, at least for all new/modified methods
* CS fixes
* package xml version 2 - 0.2.4 (beta, 2003-03-17)
Release notes
License: PHP License
* bugfix in Memory_Array::add method, which made the last element being added in a bogus way
- 0.2.3 (beta, 2003-03-11)
Release notes
License: PHP License
* Make switchDataSource work for Memory/Array, this enables you to
read the data from any source and switch the source on the run. This writes the data
from the current tree into the new source. I.e. you read the data from a DB and write
it into an array.
Switching from DB to Array makes sense i.e. if you read a tree from the DB, which you want to show
(i.e. using HTML_TreeMenu) but therefore you need to set additional properties for each
node which you don't want to save in the DB, since they are only for the presentation.
Properties for HTML_TreeMenu are i.e. the icon and some events (like 'onClick'). Since you switched
the source from DB to Array you can change any data without worrying that they are written into
the DB and modify your actual data in the DB.
* Bring Memory/Array closer to be fully useable.
* getPathAsString() takes two more parameters where you can determine from and offset
* getChildrenIds() has a new optional parameter for determining the level
* Add getDepth() to determine the maximum depth of the tree
* Make setup work with custom data optionally (only relevant for Memory_*)
* Show a nicer varDump
* add UML class diagram - 0.2.2 (beta, 2003-01-30)
Release notes
License: PHP License
- fixing a lot of E_ALL and CS issues
- enhancing getChildren method, now you can get children for more than one level
- moving the examples to docs and making TreeView and TreeEditor work properly with new php versions - 0.2.1 (beta, 2002-10-28)
Release notes
License: PHP License
- bugfix in getAllChildren[Ids], before it only worked for one level below
- 0.2 (beta, 2002-10-28)
- 0.1.2 (beta, 2002-09-30)
- 0.1.1 (beta, 2002-08-21)
- 0.1 (beta, 2002-08-13)
Bugs
| ID | Status | Type | Version | Date | Summary |
|---|---|---|---|---|---|
| #252 | Closed | Bug | 2003-11-14 | iunfinite recursion with xml -file | |
| #349 | No Feedback | Bug | 2003-12-03 | tree inserting parent as quoted string | |
| #900 | Closed | Bug | 2004-02-26 | PEAR QA: improvement for get_class()-usage | |
| #913 | Closed | Bug | 2004-02-26 | MDB Container + fixes | |
| #1302 | Bogus | Bug | 2004-04-27 | pear.php file is missing | |
| #1569 | Closed | Bug | 2004-06-07 | Tree_Memory_DBsimple has no hasChildren function hence remove doesnt work | |
| #1976 | Closed | Bug | 2004-07-25 | Missing $this-> with __construct() | |
| #2699 | Duplicate | Bug | 2004-11-05 | initial little bug | |
| #3166 | Open | Req | 2005-01-11 | Change walk/_walk to use call_user_func_array | |
| #4711 | Bogus | Req | 2005-06-29 | tree structure don't need an Doubly-linked list | |
| #4803 | Closed | Bug | 2005-07-12 | References fix | |
| #6249 | Closed | Bug | 2005-12-15 | Documentation Error | |
| #6328 | Closed | Req | 2005-12-22 | add MDB2 and improve MDB usage | |
| #7212 | Duplicate | Bug | 0.2.4 | 2006-03-27 | Fatal Error, Fix given |
| #8508 | Duplicate | Bug | 1.2.0 | 2006-08-18 | call a class method with no scope |
| #11365 | Closed | Bug | 0.3.0 | 2007-06-19 | Tree class doesnt contains raiseError method |
| #11500 | Closed | Bug | 0.3.1 | 2007-07-02 | Tree/Memory.php method getElementContent() not working |
| #11504 | Closed | Bug | 0.3.1 | 2007-07-02 | MDB2+Tree problem. MDB2 doesn't contains getTextValue method |
| #11822 | Closed | Bug | 0.3.2 | 2007-08-12 | package description should include mention of MDB2 compatibility |
| #11982 | Open | Req | 0.3.2 | 2007-09-05 | Root node not present in SQL Query |
| #11983 | Duplicate | Req | 0.3.2 | 2007-09-05 | query with no root node |
| #12780 | Closed | Bug | 0.3.2 | 2007-12-27 | DB connection instead DSN fails because of get_parent_class |
| #13080 | Closed | Bug | 0.3.2 | 2008-02-06 | MDB2simple _setup(): parentId cleared if parentId column is mapped to "parentid" |
| #13081 | Closed | Bug | 0.3.2 | 2008-02-06 | Reopen #11504: MDB2+Tree problem. MDB2 doesn't contains getTextValue method |
| #14069 | Closed | Bug | 0.3.3 | 2008-06-04 | isChildOf() delegator-method missing in Tree/Memory.php |
| #14710 | Closed | Bug | 0.3.3 | 2008-09-25 | trailing spaces in files |
| #16403 | Bogus | Bug | 2009-07-03 | Notice: Undefined index | |
| #19117 | Closed | Bug | SVN | 2011-12-08 | upgrade PHPUnit require statements (for PEAR QA Team) |
| #19119 | Closed | Bug | SVN | 2011-12-09 | Only variable references should be returned by reference |
| #19120 | Open | Bug | 0.3.5 | 2011-12-10 | setOption('columnNameMaps') does not work |
| #19185 | Assigned | Bug | SVN | 2012-01-04 | Current releases were coming from branches, not trunk. |