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

Throw exceptions for unexpected types in URI options array

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.3.0-beta1, 1.3.0
    • Affects Version/s: 1.2.2
    • Component/s: None
    • None

      Currently, the driver ignores unexpected types in the URI options array (e.g. if a ReadPreference object is passed to readPreference instead of a string value). It would be more helpful to users if we threw exceptions on unexpected types instead of silently ignoring options.

      Generic boolean options (e.g. "ssl") are currently cast via bson_iter_as_bool(), so we will continue to accept all values for such options to preserve BC (see: PHPC-990). However, boolean options for read preferences and write concerns (e.g. "slaveOk", "journal") that were previously ignored due to an unexpected type will now throw.

            Assignee:
            jmikola@mongodb.com Jeremy Mikola
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: