/** * Creates a new connection with the database or returns the active * one if there is one, so no double connections for anyone. * * @return LVPDatabase */ public static function getInstance() { if (self::$s_pInstance == null || self::$s_nRestartTime < time()) { self::restart(); self::$s_nRestartTime = time() + 86400; self::$s_pInstance = new self(); } return self::$s_pInstance; }