For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > September 2005 > Re: [PEAR] DB_DataObject









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [PEAR] DB_DataObject
Trevan Richins

2005-09-28, 6:58 pm

steven scott wrote:
> Hello,
>
> I have a couple of questions about DB_DataObject. I am a developer
> putting together a rather large website and we need some serious data
> abstraction to clean things up.
>
> We have master and slave databases and we do all the writing to the
> master and reads all come from the slaves. (usually) Is there a way
> to set up two database objects one to read from and one to write from
> automatically within the DB_DataObject class.
>
> Also if we already have a pear::DB object instantiated is is possible
> to just use that object instead of creating another connection to the
> db. We try to keep one connection open across the application. To
> limit the connection times.
>
>
> Thanks for any help.
> -Steven
>

Where I work, we have LDAP being the user database, MySQL table holding
comments about users, and a MySQL table that controls the updating of
the data. So, I made a separate DB_DO class that overrides the find,
get and such to talk with LDAP and the comments table. Then, the
update, delete, create functions are overrode to interact with the other
MySQL table. It wasn't all that easy to get it working (especially
since LDAP isn't really supported at all), but it eases coding. In our
cade, all we care about is one DB_DO class and the rest is taking care
of behind the scenes. If there is another way, I would also love to
hear it.

I don't know the answer to your other question.

Trevan

--
Trevan Richins
Computer Science Dep.
System Admin

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com