/** * Return a database connection object * * @return Creole db object */ public static function getDBConnection() { if (!self::$dbConnection) { include_once dirname(__FILE__) . DIRECTORY_SEPARATOR . "creole" . DIRECTORY_SEPARATOR . "Creole.php"; self::getLogger()->logQuery("Creating a database connection"); self::$dbConnection = Creole::getConnection(self::$dsn); self::getLogger()->logQueryExecutionTime(); self::$dbConnection->executeUpdate("SET NAMES 'utf8'"); self::$dbConnection->executeUpdate("SET @@session.sql_mode=''"); } return self::$dbConnection; }