Commit Graph

3944 Commits

Author SHA1 Message Date
Jeremy Mikola
17c38c5172 Consolidate PHP 7 conditional in WriteResult debug handler 2016-03-21 11:42:28 -04:00
Jeremy Mikola
a106fe8011 Merge branch 'v1.1' 2016-03-18 13:23:01 -04:00
Jeremy Mikola
ee6d99c4eb Back to -dev 2016-03-18 13:22:43 -04:00
Jeremy Mikola
b0c3640d3f Package 1.1.5 1.1.5 2016-03-18 13:21:25 -04:00
Jeremy Mikola
5731467b19 Merge branch 'v1.1' 2016-03-18 13:02:24 -04:00
Jeremy Mikola
009d3f7860 Merge pull request #266 2016-03-18 13:01:47 -04:00
Jeremy Mikola
b9d7d511b1 PHPC-632: Define MONGOC_NO_AUTOMATIC_GLOBALS when bundling libmongoc
This ensures that libmongoc's automatic destructor is disabled and will avoid segfaults during abrupt FPM shutdowns for static builds.

Those using the driver with system libmongoc will need to wait for CDRIVER-1160 to be released in order to resolve this issue.

Fixes #209, fixes #258
2016-03-18 13:01:30 -04:00
Jeremy Mikola
f1936ebd3e Merge pull request #263 2016-03-17 17:27:45 -04:00
Jeremy Mikola
6915ffd37f DRIVERS-289: Test iteration on live command cursor with empty first batch 2016-03-14 13:52:42 -04:00
Jeremy Mikola
6498160165 Master branch is now 1.2.0-dev 2016-03-11 11:35:31 -05:00
Jeremy Mikola
f8f7f6ab31 Back to -dev 2016-03-10 13:13:46 -05:00
Jeremy Mikola
bb96afe622 Add 1.1.4 release notes 1.1.4 2016-03-10 13:11:48 -05:00
Jeremy Mikola
e67b8b794c Bump extension version to 1.1.4 2016-03-10 13:04:54 -05:00
Jeremy Mikola
dad830a8f0 Merge pull request #260 2016-03-10 11:38:23 -05:00
Jeremy Mikola
3bb5cd81b6 PHPC-620: Lowercase hexadecimal strings in ObjectID ctor
Normalize input arguments to lowercase since libmongoc requires it.

Fixes #253
2016-03-10 11:38:08 -05:00
Jeremy Mikola
ccf9136420 Fix test title 2016-03-10 11:38:08 -05:00
Jeremy Mikola
67fdba08a8 Merge pull request #259 2016-03-10 11:37:44 -05:00
Jeremy Mikola
3c5363e581 PHPC-623: Fix 64-bit integer conversion for BSON keys
Fixes #256
2016-03-09 15:09:15 -05:00
Jeremy Mikola
e9e8443329 Back to -dev 2016-03-04 13:37:34 -05:00
Jeremy Mikola
95ab4537a2 Add 1.1.3 release notes 1.1.3 2016-03-04 13:28:16 -05:00
Jeremy Mikola
052564a002 Bump extension version to 1.1.3 2016-03-04 13:28:02 -05:00
Jeremy Mikola
31ab636b73 Merge pull request #252 2016-03-04 11:28:03 -05:00
Jeremy Mikola
4e2ab1b619 Skip PHPC-545 test on HHVM due to __pclass encoding order 2016-03-04 11:27:40 -05:00
Jeremy Mikola
9efd6471e5 Merge pull request #249 2016-03-04 11:27:05 -05:00
Jeremy Mikola
9168392c27 Improve comment in bson-toJSON_error-001.phpt 2016-03-04 11:18:17 -05:00
Jeremy Mikola
246226b743 PHPC-613: toJSON() should throw if bson_as_json() fails 2016-03-04 11:18:17 -05:00
Jeremy Mikola
fbd29313a4 PHPC-615: Return after throwing for bson_reader_read() error
This adds additional error tests for toJSON(), which demonstrate the problem when both exceptions might have been thrown.

Additionally, this ensures that the bson_reader_t is freed before returning. Previously, the code relied on the free after the second exception was thrown.
2016-03-04 11:18:17 -05:00
Jeremy Mikola
90c9c50a4b Merge pull request #250 2016-03-04 11:17:34 -05:00
Jeremy Mikola
3da1aa6e85 PHPC-616: Document and array visitors should throw for corrupt BSON 2016-03-04 10:59:41 -05:00
Jeremy Mikola
e9679a4145 PHPC-531: Fix double free in corrupt BSON visitor
Freeing the current zval in the corrupt BSON visitor causes a segfault if done for the root document, since phongo_bson_to_zval_ex() expects the calling code to initialize and free that zval on success or error.

That said, we should free when encountering an error via the document or array visitors (i.e. nested context), which would have just been initialized.
2016-03-04 10:59:01 -05:00
Jeremy Mikola
ff2709dbbd toPHP() regression tests for bson_reader_read() errors
These test cases are derived from PHPC-615.
2016-03-02 16:11:38 -05:00
Jeremy Mikola
7d6151376f Merge pull request #248 2016-03-02 07:49:06 -05:00
Jeremy Mikola
fd356f3fd7 Prevent duplication and reduce strlen() usage 2016-03-02 11:04:49 +00:00
Derick Rethans
5c366ee5b4 Fixed PHPC-506: Use more descriptive messages in WriteExceptions 2016-03-01 14:07:54 +00:00
Jeremy Mikola
3f9be21077 Merge pull request #242 2016-02-29 12:52:17 -05:00
Jeremy Mikola
e497c0155c PHPC-414: Combine 32-bit and 64-bit UTCDateTime debug handler tests
This removes a SKIPIF from the 32-bit test but leaves the 64-bit test in place, since it tests construction from a 64-bit integer type instead of a string.
2016-02-29 12:51:20 -05:00
Jeremy Mikola
cb30d5da33 Merge pull request #243 2016-02-29 12:50:40 -05:00
Jeremy Mikola
9f93fbd2c0 PHPC-593: Binary type is an unsigned 8-bit integer
This adds range checking to Binary's constructor. Internal structs and functions were changed to use uint8_t for readability.
2016-02-29 12:43:34 -05:00
Jeremy Mikola
c6574fab72 PHPC-594: Timestamp components are unsigned 32-bit integers
This adds range checking to Timestamp's constructor and changes Timestamp::__toString() to print the components as unsigned 32-bit integers. Internal structs and functions were changed to use uint32_t for readability.

32-bit platforms will be limited to the range of signed 32-bit integers, since PHP has no unsigned integer type. This will be documented in PHPC-599.
2016-02-29 12:43:34 -05:00
Jeremy Mikola
4d8e3e304a PHPC-595: Throw exception if wtimeout > INT32_MAX
This also defines a compatility constant for printing phongo_long, which may vary by PHP version and architecture.
2016-02-29 12:43:34 -05:00
Jeremy Mikola
87c53a8c9a Merge pull request #241 2016-02-29 12:41:54 -05:00
Jeremy Mikola
dcd4a6dd3d Use INT32 limit constants instead of INT/LONG 2016-02-29 12:29:23 -05:00
Jeremy Mikola
ba63ceebf0 PHPC-544: Use phongo_long in UTCDateTime ctor
This ensures that we properly check for 64-bit support in PHP 7.

Additionally, we relocate variable declarations and consolidate the conditionals so that "milliseconds" is only declared when used.
2016-02-29 12:29:23 -05:00
Jeremy Mikola
6bcba59cb5 PHPC-544: Consult SIZEOF_ZEND_LONG for 64-bit integer support
Define phongo_long and SIZEOF_PHONGO_LONG in compatibility header. On PHP 7, this will ensure we use zend_long and SIZEOF_ZEND_LONG instead of relying on long and SIZEOF_LONG.

Additionally, this adds an else condition to report a build error if the architecture is neither 32-bit nor 64-bit.
2016-02-29 12:27:52 -05:00
Jeremy Mikola
915e089c7b Remove unused macro, which is already defined in libbson 2016-02-29 12:27:52 -05:00
Jeremy Mikola
bf34b20217 PHPC-592: ADD_ASSOC_STRINGL() can only be used with string literals
The previous macro uses ZEND_STRL(), which calculates the string length via sizeof() and makes it suitable only for string literals. Since this code is utilized by php_phongo_bson_visit_int64(), we must rely on strlen() to compute the field name length.
2016-02-29 12:27:52 -05:00
Jeremy Mikola
e430814221 Revert "Merge pull request #241"
This reverts commit f5edbe2665, reversing
changes made to 6aaa45d380.
2016-02-29 12:27:11 -05:00
Jeremy Mikola
f5edbe2665 Merge pull request #241 2016-02-29 12:24:37 -05:00
Jeremy Mikola
f1c7be8318 wip 2016-02-25 10:14:47 -05:00
Jeremy Mikola
0fb63f9572 Fix whitespace 2016-02-25 10:14:47 -05:00