Re: [Fwd: Re: PEAR framework changes for PHP5]

From: Date: Sat, 31 Jan 2004 12:47:04 +0000
Subject: Re: [Fwd: Re: PEAR framework changes for PHP5]
References: 1 2 3 4 5  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-25367@lists.php.net to get a copy of this message
Hans Lellelid wrote:
Jon Parise wrote:
It's probably non-obvious, but the Log package already supports this. Here's the relevant code from the Log::factory() implementation: /*
    * Attempt to include our version of the named class, but don't treat
    * a failure as fatal.  The caller may have already included their own
    * version of the named class.
    */
@include_once $classfile; /* If the class exists, return a new instance of it. */ if (class_exists($class)) {
       return new $class($name, $ident, $conf, $level);
}
Heh -- that's cool; thanks for pointing that out to me. It would be great if PEAR classes would at least conform to that, then, so that it would be possible to create drivers/containers anywhere. Maybe they do & I just haven't realized it. :) I think having a way to refer to classes would still be useful -- e.g. so that driver classes could be specified in a conf file (of course in that case it would have to a simple text representation, rather than two element array).
Well since PEAR classes are supposed to use PEAR error handling I guess all classes should use include in order to trap possible include issues. Anyways MDB works just like Log in that respect. regards, Lukas Smith smith@backendmedia.com _______________________________ BackendMedia www.backendmedia.com berlin@backendmedia.com Linn Zwoch Smith GbR Pariser Str. 44 D-10707 Berlin Tel +49 30 83 22 50 00 Fax +49 30 83 22 50 07

« previous php.pear.dev (#25367) next »