Re:[2] [PEAR-DEV] Fix for PEAR Cache_Container_db.php
| From: | Lorenzo Alberton | Date: | Fri, 08 Nov 2002 12:20:49 +0000 |
| Subject: | Re:[2] [PEAR-DEV] Fix for PEAR Cache_Container_db.php | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-10617@lists.php.net to get a copy of this message | ||
08/11/2002 13.06.18
> diff -u old.php new.php
Yeah, that's it... I was trying with diff -a -w...
> > To sum up the changes I made:
>
> why did you remove all sprintf ? I have no opinion in which is
> better, but you shouldn't mix stylechanges (which this is) and code-
> changes in one patch. Therefore I copied your stuff into our stuff
> and didn't just do a copy&paste :)
Sorry for that... I didn't want to hurt, I just tend to use my style on
every piece of code I modify... I won't do that again, I promise...
> > - I moved the last $res = $this->db->query($query);
> > a level up because it was mis-placed, outside the right
> > parenthesis
>
> I don't see that error, you just moved
> ***
> if (DB::isError($res)) {
> return new Cache_Error('DB::query failed: '
> . DB::errorMessage($res), __FILE__, __LINE__);
> }
> ***
> into the if, but it's needed outside of the if, because it also
> checks, if something bad happened at the first DELETE
I missed that, however IMHO you should do a check for each
possible point of failure, not just a catch-all solution at the end...
This way a faulty $res is not overwritten by the next one, and
the (right) error is revealed...
> next time (unless you changed a lot in the other functions), please
> just send me your whole new db.php file, then I can make the diff by
> myself :)
Ok, I will... Or - better - I'll send you just the patch, now that I
undestand how it works :-)
> Attached is my new patch, maybe you can check it shorty and then I
> will commit it.
Seems ok to me.
Again, sorry for the "sprintf()" change... I probably have done so
for performance issues, but I can't really say that my method is faster.
I really should have respected your style...
Best regards,
Lorenzo
---
[Quipo ISP - Questa E-mail e' stata controllata dal programma Declude Virus]
[Quipo ISP - This E-mail was scanned for viruses by Declude Virus]