Re: [PHP-PEAR] Addition to DB/common.php ?

[email protected] (Kendrick Vargas)
Newsgroups php.pear
Message-ID <[email protected]>
Actually, I'd writting a class some time ago to do this. I'd been meaning
to submit it, but there are some cleanups I wanted to do, and some more
writing for it (some things are broken). It's also heavily based on
PHPLIB's DB class and at least one MySQL specific function. Porting
shouldn't be too difficult, but I don't know exactly how I'd convert it.

Usually, I extend it and include info on an auto_incremented field (for
id's), table_name, etc... Then, when I create new objects, I initialize
them with the ID, and the container pulls up the record from the database,
and lets you operate on the data. When you "commit_changes()", it
determines if anything's actually changed and then decides whether to
update, commit, or whatever.

There are also user-definable pre- and post- functions and stuff like
that.

Would there be any use for that here? Would anyone want me to post it? I
have no formal education in programming, so I guess I'd be a little
nervous about having experienced people poking and prodding at my stuff,
but if it's useful I'd love to post it and have it included.

It should not be hard to adapt to PEAR's DB. Any the one dependence
on mysql could probably be worked around. I've also got it under the LGPL,
cuz I figured that's more appropriate, or something... Don't know much
about licenses.

Let me know.
			-peace

On Thu, 1 Feb 2001, Joao Prado Maia wrote:

>
> I was doing some coding this past weekend on some personal projects and I
> ended up creating a wrapper to PEAR's DB.php for some functions that I
> usually like to use.
>
> I usually create several functions to insert / update / delete records by
> passing $table_name, $fields (associative array) and $conditions if
> appropriate.
>
> Everyone is probably going to beat me up for this, but can I add these
> functions to DB/common.php ? I'm not sure if they would be categorized as
> pure 'bloat', but I figured I should ask anyway.
>
> I could also create this as a subclass for DB.php and go from there, but
> it would be kinda too much abstraction and sub-layers of functions,
> wouldn't it ?
>
> Joao
>
> --
> João Prado Maia <[email protected]>
> http://phpbrasil.com - php com um jeitinho brasileiro
>
>
>
> --
> PHP Extension and Add-on Repository (PEAR) mailing list.
> Documentation can be found at http://pear.php.net/doc/pear.html
> To unsubscribe, e-mail: [email protected] from the
> mail address you subscribed with.
>

--- BEGIN GEEK CODE BLOCK ----------+----------
GAT d- s:+ !a C++$ UL/S/I/B++++$ P+ | "In the ongoing battle between objects
L++ E- W+(+++) N K-  w(---)  O-- M@ |  made of aluminum  going hundreds of
V(--) PS+++  PE Y+ PGP@ t++ 5 X+ R- |  miles per hour and the ground going
tv+ b- DI++++  D+(+++) G  e>++ h--- |  zero,  the  ground has yet  to lose."
r++ z+>+++ - END GEEK CODE BLOCK ---+
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.