Question

A prospective host disallows PEAR modules except for VPS/dedicated accounts. Can't afford spending $2000-3000/yr on VPS on a hobby site, so that option is out.

I'd like to add some database abstraction and recoded most of my site locally with MDB2 before running into issues with my current host (stacked server, old hardware, sluggish performance).

Are there options for implementing DB abstraction without a native PEAR module?

Was it helpful?

Solution

Are there options for implementing DB abstraction without a native PEAR module?

PECL modules require compilation and installation, thus sysadmin intervention.

PEAR modules are pure-PHP. You can simply grab the tar files from http://pear.php.net/ , extract them, and push the contents wherever they are needed. Assuming that the module(s) that you need have sane licensing, you can even bundle them with your existing source code.

That said, you should not be using PEAR's MDB2 in this day and age. Use PDO. It's PHP native and does most of the things MDB2 did, only without the suck. The convenience methods are easy to add through simple inheritance. If you actually need an SQL builder, the one included with Zend Framework (Zend Db Select) isn't too shabby.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top