Example #1
0
 /**
  * @brief connects to the database
  * @returns true if connection can be established or nothing (die())
  *
  * Connects to the database as specified in config.php
  */
 public static function connect($backend = null)
 {
     if (self::$connection) {
         return;
     }
     if (is_null($backend)) {
         $backend = self::getDBBackend();
     }
     if ($backend == self::BACKEND_PDO) {
         self::connectPDO();
         self::$connection = self::$PDO;
         self::$backend = self::BACKEND_PDO;
     } else {
         self::connectMDB2();
         self::$connection = self::$MDB2;
         self::$backend = self::BACKEND_MDB2;
     }
 }