Re: [PATCH] DB::connect(): stuff that should be in DB::factory()
| From: | Tomas V.V.Cox | Date: | Tue, 03 Jun 2003 12:27:05 +0000 |
| Subject: | Re: [PATCH] DB::connect(): stuff that should be in DB::factory() | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-16946@lists.php.net to get a copy of this message | ||
DB::factory() was nice for me to test parseDSN() ... but appart of it, why
would DB need to provide factory()?
Tomas V.V.Cox
----- Original Message -----
From: "Roman Neuhauser" <neuhauser@bellavista.cz>
To: "pear-dev" <pear-dev@lists.php.net>
Sent: Tuesday, June 03, 2003 1:59 PM
Subject: [PEAR-DEV] [PATCH] DB::connect(): stuff that should be in
DB::factory()
> The fact that the creation process is different across connect() and
> factory() has always bothered me, plus, there's no need to have the
> code twice: one incarnation will inevitably suffer, as evidenced by
> the contents of factory(), with poorer error message etc.
>
> Note: passing the whole $options array to factory() is not neccessary
> but this is the simplest patch that still works. If you want me to
> change this, let me know.
>
> Log message:
>
> DB::connect() uses DB::factory() to instantiate the appropriate
> class.
>
> Body of factory() was replaced with instantiation code from
> connect() (better error message, etc).
>
> factory() now takes two arguments, the second being $options
> (passed through from connect()); it's used just as it used to be in
> connect().
>
> --
> If you cc me or remove the list(s) completely I'll most likely ignore
> your message. see
> http://www.eyrie.org./~eagle/faqs/questions.html
>
----------------------------------------------------------------------------
----
> --
> PEAR Development Mailing List (http://pear.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php