[wp-hackers] WP, PHP5, PEAR::DB, SQLite

kellan at protest.net kellan at protest.net
Sat Jul 17 20:59:34 UTC 2004


I'm pretty new to WordPress, so sorry if I'm bringing up an old
conversation. (though a quick Google didn't turn up anything obvious)

I just tried to install an internal dev blog with WP.  We use PHP5 for all
of our development, and have been for a few months now (can't recommend it
highly enough! We've experienced no breakage, nor have seen any on my open
source project, Magpie). So naturally I tried to install WP (1.2 and the
most recent nightly-2004-7-14) under PHP5.  Without success unfortunately.
I posted the exact errors over in the forums.[1]

The gist of it however is the problem lies in wp-db.php.  Which made me
wonder why WP is maintaining its own DB abstraction layer?

If wp-db.php could be transformed into a wrapper for PEAR::DB there could
be some really great wins, including:
  * works under PHP5
  * works with databases other then MySQL (like SQLite)
  * someone else's responsibility to maintain/fix!

I love MySQL, but SQLite support in WP would be huge.  It would mean you
could install WP anywhere you have PHP without having to worry about what,
if any, database you have installed.  And it would allow you to migrate
your blog easily, by tarring up the directory, and transferring it to a
new box, no worries about dumping the database.

I realize that just using a DB abstraction layer isn't a silver bullet for
cross DB compatibility, but it is an important first step.

The argument I've heard (and made) against relying on PEAR is it makes
installation harder, and including an entire PEAR dependency tree in your
application can be a mess. (this is why Magpie ships with its own HTTP
client, rather then relying on PEAR HTTP)  However PEAR::DB has only one
dependency, PEAR itself, which has shipped with recent versions of PHP for
a while now.

I really think that using PEAR::DB is going to be the easiest way to get
WP working under PHP5, and to get SQLite support.

Thanks
-kellan

1. http://wordpress.org/support/2/8750#post-9

p.s. I see discussion in the forums about how WP uses ezSQL, which I
assume in the source of the logic in wp-db.php.  I couldn't really comment
on this one way or another except to say WP clearly isn't using ezSQL's
advertised cross platform support.  I was going to check out ezSQL's
implementation, however they don't allow downloads without going through
their annoying email capture form, which is just another reason to use
PEAR::DB.

--
"ideas are far more powerful than guns. we don't allow our enemies to
have guns, why should we allow them to have ideas?" [joseph stalin]

kellan at protest.net



More information about the hackers mailing list