Re: DB_DataObject and specific mysql client encoding
| From: | Markus Fischer | Date: | Mon, 28 Aug 2006 15:11:04 +0000 |
| Subject: | Re: DB_DataObject and specific mysql client encoding | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-25004@lists.php.net to get a copy of this message | ||
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Justin Patrin wrote:
> On 8/28/06, Markus Fischer <markus@fischer.name> wrote:
>> I made a class "Custom_DB_DataObject extends DB_DataObject" and
>> re-implemented _connect(). It's intersting that the real _connect() is
>> marked as private which would prevent overriding it, luckily PEAR is
>> PHP4 code so this is not enforced:
>
> One other solution would be to create a DO (after you set up config,
> of course) then use getDatabaseConnection() to get the DB object, then
> run your query.
You mean, every time and at every place I factor a DataObject, I run
something like
$DO->getDatabaseConnection()->query("SET NAMES ...");
?
But forgeting this at some point seems more error prone than having it
part of DO ...
- - Markus
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFE8weI1nS0RcInK9ARApfYAKDW1Plnc0WqyW1KMvs6JRy9mVEjEgCeIqVo
uarvrrQGTrObV6xlSOT1d5c=
=CIrq
-----END PGP SIGNATURE-----