[ZendTo] Re: [patch] trouble with SQLite 3 (PHP 5.3.9-1) on debian wheezy / feature: dropoff only after request

Joerg Streibhardt eljoest+lists at googlemail.com
Tue Jan 31 09:28:31 GMT 2012


Hi Jules,

thanks for the response.

> What was wrong with the SQLite support I had already written for it? Why
> some "wrapper"?

I didn't feel there's something wrong with your code. Debian does not
provide SQLite 2 support, so everything in SQLite.php that uses SQLite
2 calls or properties such as "SQLITE_ASSOC", "arrayQuery",
"queryExec", "singleQuery", "new SQLiteDatabase",
"sqlite_escape_string" will cease to work.
The wrapper emulates the missing or changed methods on top of a
SQLite3 object to minimize the impact on the code you wrote (quite
nice code, b.t.w.). The constants are simply mapped from one version
to the other. The latter would be problematic in dual installations
but could be changed.

>>   * This includes changed calling of the sqlite_escape_string - function.
> Again, why?

This served two purposes: The primary intention is to allow for a
common interface (SQLite2/3, maybe even MySQL) that only needs minor
changes to the logic to be ported from one DB interface to the other
(i.e. http://mailman.ecs.soton.ac.uk/pipermail/zendto/2012-January/001343.html).
The other intention is that I didn't want to create a global override
that might clash in situations where both SQLite 2 and 3 are
available, but a user decides to use 3 (see the constants above).

>>   * I've noticed issues with htmlentities in some places, so I've
>> modified the calls I've found (only to later find calls that were
>> already changed to include a charset).
> Such as what issues?

Encoding of UTF-8 non-ascii characters (two or more bytes). Which
means I got "ä" instead of "ä".

> Sorry, no-one else has ever asked for that so I'm reluctant to include
> that in the distribution.

No problem, I'll have to maintain the patch myself.

> Sorry if I sounded negative above, but you've given me no reason
> whatsoever *why* you have made any of these changes.

Sorry for the lack of explanation. Having just worked on the code I
felt the changes would explain themselves. After a good night's sleep
it's obvious to me that I should have provided my motivation.

Regards
Jörg



More information about the ZendTo mailing list