Uploaded image for project: 'PHP Driver: Extension'
  1. PHP Driver: Extension
  2. PHPC-1629

Call libmongoc is_valid functions before completing WriteConcern and ReadPreference initialization

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Minor - P4
    • Resolution: Fixed
    • None
    • 1.8.0-beta2, 1.8.0
    • None
    • None

    Description

      mongoc_write_concern_is_valid is called only once in the driver near the end of php_phongo_apply_wc_options_to_uri.

      mongoc_read_prefs_is_valid is called from php_phongo_apply_rp_options_to_uri and at the end of the ReadPreference constructor. As discussed in a PR comment for PHPC-1571, calling this at the end of the constructor likely serves as a fail safe in case we missed throwing a more helpful exception for incompatible options.

      I'd propose we these is_valid checks from each class' init_from_hash function, as well as introduce a final call to mongoc_write_concern_is_valid in the WriteConcern constructor.

      Attachments

        Activity

          People

            andreas.braun@mongodb.com Andreas Braun
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: