CodeKit PHP Handle Creation

How to create a new PHP CodeKit access handle.

new CodeKit()

require_once('CodeKit.php');

$codekit = new CodeKit($dbh, array(
                         'table' => 'ck_code'
                         )):

The new CodeKit() method returns a new CodeKit handle object.

$dbh must be either a PEAR DB or a phplib database handle.

The optional 'table' parameter can be used to specify which of several code tables to use. The default is 'ck_code'.

Using PEAR DB

Here is an example of how to use the PEAR DB library. If you already have a PEAR DB handle open, just pass it into CodeKit.
require_once('DB.php');
$pear_dbh = DB::connect("mysql://webbysoft:124c41@localhost/webbysoft");
if (DB::iserror($pear_dbh)) {
    die($pear_dbh->getMessage());
}

require_once('CodeKit.php');

$codekit = new CodeKit($pear_dbh);

Using phplib

Here is an example of how to use the phplib library. If you already have a phplib handle open, just pass it into CodeKit.
require_once('/usr/lib/phplib/db_mysql.inc');
$phplib_dbh            = new DB_Sql;
$phplib_dbh->Host      = 'localhost';
$phplib_dbh->Database  = 'webbysoft';
$phplib_dbh->User      = 'webbysoft';
$phplib_dbh->Password  = '124c41';

require_once('CodeKit.php');

$codekit = new CodeKit($phplib_dbh);