private static function getConnection() { if (self::$db_connection === null) { self::$db_connection = new Mongo("mongodb://*****:*****@ds029107.mongolab.com:29107/albums"); } return self::$db_connection; }
/** * * @access public * @static * @return bool */ public static function Init() { try { self::$db_connection = @mysql_connect(Settings::$mysql_host, Settings::$mysql_user, Settings::$mysql_password); @mysql_select_db(Settings::$mysql_database, self::$db_connection); if (mysql_error()) { throw new DatabaseException(mysql_error()); } } catch (Exception $e) { Debug::Log($e, ERROR); return false; } return true; }