KjwLib-php45

1.0-svn

KjwLib-45 is a PHP4.3+ and PHP5 compatible library for PHP. It tries to simplify a couple of common operations, most notably the use of database storage, early error handling (with backtraces by mail or as inline-html) and plain mail support that handles UTF-8 properly.

Database example

 //define('KJW_STDLOG', fopen('/tmp/debug_log', 'w')); // uncomment to get debug log
 require_once 'KjwSql.php';
 $db = kjwsql_from_url('mysql://user:pass@host/database');
 $db->insertArray('mytable', array('string_column', 'somestring', 'int_column', 1234));
 echo $db->insertId();
 

This does the following behind the scenes:

Error handling example

 ini_set('date.timezone', 'Europe/Amsterdam'); // only set this if not set in config already
 error_reporting(E_ALL | E_STRICT); // optional, depends on your config
 define('KJW_EMAIL_ERRORS_TO', 'your-email@example.com'); // don't define this if you want your errors on display
 require_once 'KjwLib.php';
 $x = $undefined_variable; // <-- THIS TRIGGERS AN ERROR
 

This makes sure that you get a pretty backtrace about where you're referencing $undefined_variable before it was set, either by mail or on display.


Generated on Wed Apr 8 22:16:35 2009 for KjwLib-php45 by  doxygen 1.5.8