Search code examples
pear

PEAR Log class using PDO


We are in the process of updating our site from using the PEAR DB ( http://pear.php.net/package/DB ) to PHP PDO (http://www.php.net/manual/en/book.pdo.php) for connection to our database. In doing so the PEAR Log (http://pear.php.net/package/Log) class is not setup so you can use PDO. Has anyone built a wrapper or have any suggestions on how to get this to work?


Solution

  • The best thing to do would be to create a Log_pdo class, based on the Log_mdb2, Log_sqlite and other such classes that are included in the Log package that would be a working implementation of the Log class as declared in Log.php

    Do this by cloning the 'official' repo at https://github.com/pear/Log and then send a pull request when you are done (and perhaps log a feature request at https://github.com/pear/Log/issues) so others might be able to benefit from your work.

    It might not give you fame and fortune, but you'll be contributing to Open Source which always looks good on your CV. ;-)