PHP Legacy Driver
  1. PHP Legacy Driver
  2. PHP-407

MongoBinData should default to type 0 instead of 2

    Details

    • Type: Task Task
    • Status: Closed Closed
    • Priority: Minor - P4 Minor - P4
    • Resolution: Fixed
    • Affects Version/s: 1.2.10
    • Fix Version/s: 1.5.0, 1.5.0RC1
    • Component/s: pecl-mongo
    • Labels:
      None
    • Backwards Compatibility:
      Minor Change
    • # Replies:
      15
    • Last comment by Customer:
      true

      Description

      According to http://bsonspec.org/#/specification, type \x00 should be the default for BinData:

      This is the most commonly used binary subtype and should be the 'default' for drivers and tools.

      Type \x02, the PHP driver's current default, is deprecated:

      This used to be the default subtype, but was deprecated in favor of \x00. Drivers and tools should be sure to handle \x02 appropriately. The structure of the binary data (the byte* array in the binary non-terminal) must be an int32 followed by a (byte*). The int32 is the number of bytes in the repetition.

        Issue Links

          Activity

          Hide
          Andrew Tchircoff
          added a comment -

          I understand, but can you think about moving it to config then, like mongo.gridfs.bindata.type?

          Show
          Andrew Tchircoff
          added a comment - I understand, but can you think about moving it to config then, like mongo.gridfs.bindata.type?
          Hide
          Githook User
          added a comment -

          Author:

          {u'username': u'jmikola', u'name': u'Jeremy Mikola', u'email': u'jmikola@gmail.com'}

          Message: PHP-962: Define constants for MongoBinData subtypes 0 and 4

          Subtype 0 is the new default (to be changed in PHP-407), which replaces deprecated subtype 2. Subtype 4 is the new UUID type, which enforces the RFC spec, to replace deprecated subtype 3.

          Additionally, replace hard-coded values in bin_data.c with the defined constants.
          Branch: master
          https://github.com/mongodb/mongo-php-driver/commit/62b1e0c623e0fbe7f4b22a4ab5f3fbccf9d98af6

          Show
          Githook User
          added a comment - Author: {u'username': u'jmikola', u'name': u'Jeremy Mikola', u'email': u'jmikola@gmail.com'} Message: PHP-962 : Define constants for MongoBinData subtypes 0 and 4 Subtype 0 is the new default (to be changed in PHP-407 ), which replaces deprecated subtype 2. Subtype 4 is the new UUID type, which enforces the RFC spec, to replace deprecated subtype 3. Additionally, replace hard-coded values in bin_data.c with the defined constants. Branch: master https://github.com/mongodb/mongo-php-driver/commit/62b1e0c623e0fbe7f4b22a4ab5f3fbccf9d98af6
          Show
          Jeremy Mikola
          added a comment - https://github.com/mongodb/mongo-php-driver/pull/601
          Hide
          Githook User
          added a comment -

          Author:

          {u'username': u'jmikola', u'name': u'Jeremy Mikola', u'email': u'jmikola@gmail.com'}

          Message: PHP-407: Default MongoBinData to type 0 and remove E_DEPRECATED notice

          This removes using deprecated type 2 as the default, and also does away with the deprecation notice when the constructor's type argument was not specified (introduced by d9ed9c49f176e0c30eacaed002c8b1997464b9dc in 1.2.11).

          The bug00407.phpt test is made redundant by changes to mongobindata-001.phpt and has been removed.
          Branch: master
          https://github.com/mongodb/mongo-php-driver/commit/242f004388f36a26a7f4ea515bd877d8bba159f0

          Show
          Githook User
          added a comment - Author: {u'username': u'jmikola', u'name': u'Jeremy Mikola', u'email': u'jmikola@gmail.com'} Message: PHP-407 : Default MongoBinData to type 0 and remove E_DEPRECATED notice This removes using deprecated type 2 as the default, and also does away with the deprecation notice when the constructor's type argument was not specified (introduced by d9ed9c49f176e0c30eacaed002c8b1997464b9dc in 1.2.11). The bug00407.phpt test is made redundant by changes to mongobindata-001.phpt and has been removed. Branch: master https://github.com/mongodb/mongo-php-driver/commit/242f004388f36a26a7f4ea515bd877d8bba159f0
          Hide
          Githook User
          added a comment -

          Author:

          {u'username': u'jmikola', u'name': u'Jeremy Mikola', u'email': u'jmikola@gmail.com'}

          Message: PHP-407: Add PHP_MONGO_ prefix to binary data type constants
          Branch: master
          https://github.com/mongodb/mongo-php-driver/commit/efd062329f11ff271a27ee6b161156e5dc1cc592

          Show
          Githook User
          added a comment - Author: {u'username': u'jmikola', u'name': u'Jeremy Mikola', u'email': u'jmikola@gmail.com'} Message: PHP-407 : Add PHP_MONGO_ prefix to binary data type constants Branch: master https://github.com/mongodb/mongo-php-driver/commit/efd062329f11ff271a27ee6b161156e5dc1cc592

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since reply:
                1 year ago
                Date of 1st Reply: