/** * Initializes the database link $_db with its variables * * Creates a new mysqli object and stores that database link for use in the * other static methods of the class. * * @param string $db_URL the string of the database's URL to connect to * @param string $db_username the string of the database username * @param string $db_password the string of the database password * @param string $db_name the string of the database name to connect to * @param string $db_salt the string of the salt used for encryption * * @return void * @throws die kills the page if we cannot connect. Why bother continuing? * * @access public * @static */ public static function initialize($db_URL, $db_username, $db_password, $db_name, $db_salt) { self::$_db = new mysqli($db_URL, $db_username, $db_password, $db_name); if (self::$_db->connect_errno > 0) { die('Unable to connect to database [' . self::$_db->connect_error . ']'); } self::$_salt = $db_salt; }