Re: Tree-class for PEAR
| From: | Wolfram Kriesing | Date: | Thu, 31 Jan 2002 09:42:31 +0000 |
| Subject: | Re: Tree-class for PEAR | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-4310@lists.php.net to get a copy of this message | ||
> >> as i announced yesterday i have written a PEAR-conform Tree
> >> class which can handle trees, which are either read from the DB
> >> or an XML file, you can manipulate, navigate etc. in the tree
> >
> >I vote yes
>
> +1. Even though I do not have the time to look deeper into
> Wolfram's code at the moment, I think we should have a rock-solid
> mechanism to build tree structures in PEAR.
well i have one issue that might be necessary to clear out before
committing the Tree class to PEAR
I extend the classes either from "myPEAR_Common" or
"myPEAR_CommonDB", those classes contain common functionality which i
use throughout a lot of classes and which is also used throughout
many other classes in PEAR, and until now, if i am right, it is
always copy-pasted into the different classes.
those classes contain:
myPEAR_Common:
-----------------------
- setOption( $option, $value)
- setOptions( $options)
- getOption( $option )
all those methods set/get values in the internal property-array
"options" just as it is used in PEAR::DB, which is used to configure
the class extending it
all those methods work on the internal array "options" just as it
works in PEAR::DB
myPEAR_CommonDB extends myPEAR_Common
-------------------------------------------------------
- _connect
this method connects to the DB using the given DSN upon calling the
constructor, it also verifies the DSN, since that is needed in
multiple classes
i am thinking of the following ways to solve this:
1.
put those classes into the file PEAR.php, which is producing overhead
in this file, since not every application uses the options-thing
2.
writing a class that extends PEAR.php and putting it in there and let
classes, which use options exnted this class
3.
copy-pasting it in each class :-(
i'd like to see 2. realized, 1. would be ok too
BTW what is a final "go" for committing the class?
--
Wolfram