It would be nice if we depend on db_debug here and not force an error screen:

    if ($this->db->db_debug)
    {
        show_error($prefs['filepath']." could not be read. Please make sure it's accessible.");
    }

(also changed the code style for better readability.