654 Commits

Author SHA1 Message Date
Jeremy Mikola
96c6b3f16d PHPC-933: Remove unnecessary zend_string_release() 2017-03-10 13:51:07 -05:00
Jeremy Mikola
e25091bd75 PHPC-917: Bump libmongoc and libbson to 1.5.5
Includes CDRIVER-2057, which fixes the default value for localThresholdMS.
2017-03-07 11:41:25 -05:00
Jeremy Mikola
f2b4eb72fa PHPC-736: Remove zend_str_tolower_dup() in ObjectID construction 2017-03-03 13:55:22 -05:00
Jeremy Mikola
e40a4c6a0b Rename function argument to avoid shadowing 2017-03-03 13:53:58 -05:00
Jeremy Mikola
0244d19cd3 PHPC-923: Use zend_string_release() to free class names 2017-03-03 09:41:58 -05:00
Jeremy Mikola
139ad8e12c PHPC-924: Avoid unnecessary BSON conversion in Cursor::setTypeMap() 2017-03-03 09:23:02 -05:00
Jeremy Mikola
faae013abe PHPC-898: Bump libmongoc and libbson to 1.5.4
Includes CDRIVER-2003, which fixes an issue with queries using a read concern.
2017-01-30 17:11:15 -05:00
Jeremy Mikola
8456780ac9 PHPC-894: Implement get_gc handlers for BSON classes
This addresses a memory leak if gc_possible_root() were to invoke the existing get_properties handlers.
2017-01-23 20:39:57 -05:00
Jeremy Mikola
a1cd524217 PHPC-881: Bump libmongoc and libbson to 1.5.3
Includes CDRIVER-1964, which fixes an issue with opening the Windows CA store.
2017-01-13 16:43:59 -05:00
Jeremy Mikola
4d0706139b Merge pull request #500 2017-01-11 11:16:25 -05:00
Jeremy Mikola
f94383812e Remove duplicate #include 2017-01-11 11:14:20 -05:00
Jeremy Mikola
3ff292cbb8 PHPC-879: Remove dependency on php_date_get_immutable_ce() 2017-01-11 11:14:20 -05:00
Jeremy Mikola
997fe40f9c PHPC-878: Remove dependency on php_json_serializable_ce symbol
Since JsonSerializable is required, this also adds a helpful startup error message if json.so is not already loaded.
2017-01-11 11:14:20 -05:00
Jeremy Mikola
84dbfe07f7 PHPC-891: BSON encoding should throw if PHP keys contain null bytes
Since PHP uses leading null bytes in object properties to denote protected and private members, we ignore those keys in lieu of throwing an exception.
2017-01-10 12:00:49 -05:00
Jeremy Mikola
caa4650f73 PHPC-886: Always recalculate field name length when encoding BSON 2017-01-10 12:00:49 -05:00
Jeremy Mikola
b3b3a550e4 PHPC-884: Do not skip public property with empty string name during BSON encoding
This removes our is_public_property() helper function in favor of a simpler check on the mangled property name (as done by PHP's json_encode() function).
2017-01-10 12:00:49 -05:00
Jeremy Mikola
3a4da1c74c PHPC-883: BSON array keys should be disregarded during visitation 2017-01-09 11:15:39 -05:00
Jeremy Mikola
7fbef008fe Remove $Id$ SVN keyword instances 2017-01-06 15:43:18 -05:00
Jeremy Mikola
2efc183b38 PHPC-890: Add license header copypasta 2017-01-06 15:41:58 -05:00
Jeremy Mikola
86f882668c PHPC-855: Bump libmongoc and libbson to 1.5.1 2016-12-19 11:30:40 -05:00
Jeremy Mikola
2599607b47 PHPC-635: WriteResult debug handler should return objects 2016-12-19 09:40:29 -05:00
Jeremy Mikola
6b41ed0e87 Remove trailing whitespace 2016-12-12 19:31:45 -05:00
Jeremy Mikola
120b270377 PHPC-851: Separate argument zvals before modification
This primarily fixes a bug introduced in 6d46d62577 for PHPC-359, since we convert tag sets from arrays to objects to ensure proper BSON serialization. Not only was the array mutation visible to calling contexts, but a crash could occur if the array was immutable due to OPcache.

For Manager's $driverOptions, a comment in 1060cb8ba4 for PHPC-433 indicated that we should have separated its zval due to possible modification, but the appropriate zend_parse_parameters() flag was never used.
2016-12-12 19:31:45 -05:00
Jeremy Mikola
0dd057d4d7 PHPC-849: Fix leaking of current element in setTypeMap() 2016-12-12 12:59:00 -05:00
Jeremy Mikola
8033c1b09a Refactor out php_phongo_cursor_free() 2016-12-12 12:59:00 -05:00
Jeremy Mikola
32b93dba33 Move cursor iterator handlers into Cursor.c 2016-12-12 12:59:00 -05:00
Jeremy Mikola
9f0fedcb44 Only fetch TSRMLS for 32-bit platforms in int64 visitor
This fixes a build error introduced in be58940cd9.
2016-12-12 12:53:43 -05:00
Jeremy Mikola
99f4cbc673 Merge branch 'v1.1' 2016-12-07 12:26:07 -05:00
Jeremy Mikola
129753881a PHPC-848: Consult ZEND_HASH_APPLY_PROTECTION() in PHP7
When a numeric array was encoded to BSON, the hash's apply counter was incremented and decremented irrespective of whether apply protection was enabled. This was not compatible with immutable arrays, which may be created by OPcache. We now consult ZEND_HASH_APPLY_PROTECTION() whenever an apply counter might be modified.

Previously, object_to_bson() incremented the apply counter when converting a MongoDB\BSON\Type instance. Associative arrays and other objects were not protected. This patch adds recursion checking for those types.

Since PHP7 already has macros for working with the apply counter, this patch adds equivalent macros for PHP 5.x.
2016-12-07 10:55:59 -05:00
Jeremy Mikola
be58940cd9 Ensure php_phongo_bson_visit_int64() has TSRMLS vars if needed
Fixes a 32-bit build error introduced in 22a39d68f3 for PHPC-313
2016-11-29 15:45:11 +01:00
Jeremy Mikola
8b173d90d9 PHPC-654: Javascript comparison handler 2016-11-28 12:49:12 +01:00
Jeremy Mikola
ae987ca82f PHPC-654: UTCDateTime comparison handler 2016-11-28 12:49:12 +01:00
Jeremy Mikola
7a12b863ba PHPC-654: Timestamp comparison handler 2016-11-28 12:49:12 +01:00
Jeremy Mikola
bdb5f3c6ba PHPC-654: Regex comparison handler 2016-11-28 12:49:12 +01:00
Jeremy Mikola
994a1dac7b PHPC-654: Binary comparison handler 2016-11-28 12:49:12 +01:00
Jeremy Mikola
767fb73b84 Remove unused get_debug_info handlers
These should have been removed for PHPC-460.
2016-11-28 12:49:12 +01:00
Derick Rethans
c50d63d74f PHPC-533: Remove PHONGO_API macro for exported functions 2016-11-28 11:47:13 +00:00
Jeremy Mikola
5c63b8d229 PHPC-838: Preserve scope when serializing Javascript to BSON 2016-11-28 11:32:01 +00:00
Derick Rethans
962e5e89d7 PHPC-791: Upgrade libbson and libmongoc to 1.5.0 2016-11-28 11:32:01 +00:00
Derick Rethans
43b06f0ca3 PHPC-827: Update Max Staleness implementation 2016-11-28 11:32:01 +00:00
Jeremy Mikola
6fd69afc1f PHPC-790: UTCDateTime constructor should truncate floats 2016-11-23 13:06:24 -05:00
Jeremy Mikola
8d7e358330 PHPC-804: Relax zpp types in Timestamp and UTCDateTime constructors
Changing "s" to "z" in zend_parse_parameters() allows integers to be accepted in strict types mode. If all necessary parameters are integers, we can also skip conversion to a string and back to a 64-bit integer.
2016-11-23 12:15:37 -05:00
Jeremy Mikola
1f785d2cb1 Use consistent string parsing for Timestamp and UTCDateTime init
bson_ascii_strtoll() will support range checking in libbson 1.5.0 (CDRIVER-1377), so there is no longer any benefit of using _atoi64() on Windows. This will make parsing consistent across both platforms, since _atoi64() does not report errors for non-integer strings (e.g. "1.2").
2016-11-22 15:32:32 -05:00
Jeremy Mikola
dd1a758f00 PHPC-829: BSON Regex flags must be alphabetically ordered
We do not test that MongoDB\BSON\fromJSON() alphabetizes the flags, as that will be handled by CDRIVER-1883.
2016-11-22 11:09:01 -05:00
Jeremy Mikola
c546045f44 PHPC-756: Do not eval bson_error_t.message as boolean 2016-11-21 15:46:35 -05:00
Jeremy Mikola
96f24c9d61 PHPC-459: BSON types implement JsonSerializable 2016-11-16 12:09:34 -05:00
Jeremy Mikola
b7dbc99be7 PHPC-805: Query "partial" option is now "allowPartialResults" 2016-10-20 16:07:26 -04:00
Jeremy Mikola
1470d5c439 PHPC-791: Bump libbson and libmongoc to 1.5.0-rc3 2016-10-20 15:54:30 -04:00
Jeremy Mikola
97e64405c7 PHPC-820: Upgrade libbson and libmongoc to 1.3.6 2016-10-20 13:04:09 -04:00
Derick Rethans
eb35da1c2c PHPC-788: Timestamp on 32-bit platforms breaks 2016-10-18 10:51:31 +01:00