Saffrongeek’s Diarylog
…..memoirs moments opened…

Posts Tagged ‘database’

civicrm- dbhandle function I use a lot of times

August 18, 2009

In my cron class scripts, I very fondly make use of the function for dbhandle , got from civicrm files itself.
static function &dbHandle( &$config ) {
CRM_Core_Error::ignoreException( );
$db_uf = DB::connect($config->userFrameworkDSN);
CRM_Core_Error::setCallback();
if ( ! $db_uf ||
DB::isError( $db_uf ) ) {
CRM_Core_Error::statusBounce( ts( “Cannot connect to db via %1. Please check the CIVICRM_UF_DSN value in your   civicrm.settings.php file”,
array( 1 => [...]