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

Refactor php_phongo_bson_state struct initialization for debug output

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 1.7.0
    • Affects Version/s: None
    • Component/s: None

      We frequently do the following when converting BSON to a PHP value for debug info functions:

      php_phongo_bson_state state = PHONGO_BSON_STATE_INITIALIZER;
      /* Use native arrays for debugging output */
      state.map.root_type = PHONGO_TYPEMAP_NATIVE_ARRAY;
      state.map.document_type = PHONGO_TYPEMAP_NATIVE_ARRAY;
      

      Rather than duplicate this everywhere, we should refactor this with either a macro or simply a second initializer struct (e.g. PHONGO_DEBUG_BSON_STATE_INITIALIZER).

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

              Created:
              Updated:
              Resolved: