Commit Graph

3944 Commits

Author SHA1 Message Date
Andreas Braun
70bdd80bc7 PHPC-2166: Add missing void arg to fix MacOS builds (#1410) 2023-04-12 08:23:21 +02:00
Jeremy Mikola
04d1a96627 PHPC-2200: Add MongoDB rapid releases to Evergreen matrix (#1408)
* Add rapid to mongodb-versions axis

* Bump latest-stable to 6.0 in mongodb-edge-versions matrix

* Include newer server versions in OCSP, requireApiVersion, loadBalanced, and skip_crypt_shared matrices

* Rename VERSION to MONGODB_VERSION

* Unwrap array in single value matrix_spec configuration
2023-04-11 04:14:01 -04:00
Jeremy Mikola
e5dd7164b2 PHPC-2195: Use less ambiguous path in mongocrypt.h compat include (#1407)
Add an ifndef block so we're not just relying on the actual mongocrypt.h include.

Add copyright headers to libmongocrypt-compat headers.
2023-04-05 07:08:22 -04:00
Andreas Braun
4e9da57be1 Merge branch 'v1.15'
* v1.15:
  Back to dev
  Package 1.15.1
2023-02-09 13:14:24 +01:00
Andreas Braun
ff39c4a603 Back to dev 2023-02-09 13:13:55 +01:00
Andreas Braun
3be2d9cf97 Package 1.15.1 1.15.1 2023-02-09 12:04:47 +01:00
Andreas Braun
77fd5a2aeb Merge branch 'v1.15'
* v1.15:
  Update libmongoc to 1.23.2 (#1399)
2023-02-09 11:57:04 +01:00
Andreas Braun
2e27d1b540 PHPC-2188: Test that tlsDisableOCSPEndpointCheck is allowed in CSFLE options (#1402) 2023-02-02 10:58:10 +01:00
Andreas Braun
43b5499e01 PHPC-2156: Work around crypt_shared log output (#1403) 2023-02-02 10:41:13 +01:00
Andreas Braun
a60643edc3 Update libmongoc to 1.23.2 (#1399) 2023-01-17 10:51:37 +01:00
Andreas Braun
18901bbe1c Update libmongoc and libmongocrypt (#1398)
* Update to latest libmongoc dev version

* Update to latest libmongocrypt dev version
2023-01-12 09:23:16 +01:00
Andreas Braun
d738d27d38 Merge branch 'v1.15'
* v1.15:
  PHPC-2185: Windows builds for PHP 7.4 (#1397)
  Fix null pointer access for write concern errors without a message (#1396)
2023-01-12 09:07:38 +01:00
Andreas Braun
c543c58204 PHPC-2185: Windows builds for PHP 7.4 (#1397) 2023-01-12 09:05:37 +01:00
Andreas Braun
83595022fb Fix null pointer access for write concern errors without a message (#1396) 2023-01-12 08:47:45 +01:00
Jeremy Mikola
1650a911dd PHPC-2174: Bump libmongocrypt to 1.6.2 (#1394) 2022-12-27 23:04:58 -05:00
Jeremy Mikola
542d1d3007 Cross-reference prose tests in session test descriptions (#1393)
* Remove redundant params in create_test_manager() calls

* Use disableClientPersistence in session test requiring different clients
2022-12-22 03:21:45 -05:00
Andreas Braun
a237193eca BSON class implementations (#1387)
* Extract bson to json conversion logic

* PHPC-326: Add class to represent raw BSON document

* PHPC-326: Add class to represent raw BSON array

* Typemaps now support raw BSON type

* Short-circuit encoding of BSON zvals

* PHPC-324: Add BSONIterator class

* Polyfill zend_array_is_list on PHP < 8.1

* Add offset accessors to BSON classes

* Add more tests around iterators and fetching offsets

* Remove compare handler for BSONIterator

* Rename BSONArray to ArrayList

* Rename BSONDocument to Document

* Rename BSONIterator to Iterator

* Implement Document::fromBSONString

* Test BSON document in bson-corpus tests

* Fix ArrayList handling of BSON arrays with wrong keys

* Address code review for bson-corpus tests

* Address code review in ArrayList

* Address code review for Document

* Address code review for Iterator

* Allow BSON iterators to be rewound

* Address code review in tests

* Fix comment explaining php_phongo_bson_append_object

* Remove obsolete php_phongo_bson_append_zval

* More review changes to tests

* Return base64 encoded data when debugging BSON classes

* Allow serialisation of Document and ArrayList

* Add test for iterating past the end of a structure

* Update exception message to contain class name

* Make BSON pclass handling test more complete

* Fix wrong handling of type map in nested structures

* Ensure objects are backed by actual memory

* Validate UTF-8 BSON data before returning it

* Allow ArrayList::toPHP() to accept a different root type map

* Ignore null return type for invalid BSON iterators on PHP < 8

* Throw when calling get on non-existing BSON offsets

* Remove unnecessary length from serialised output

* Refactor names around type map handling

* Use short array syntax in new tests

* Improve test descriptions

* Restructure BSON iterator tests

* Expand BSON class serialisation tests

* Throw exception when iterator is exhausted

The previous method relied on the type system of PHP to throw an exception when accessing the key of an exhausted iterator, but this does not work on non-debug versions of PHP.

* Update test description

* Rename ArrayList class to PackedArray
2022-12-16 08:48:09 +01:00
Jeremy Mikola
9351ccaee1 PHPC-2164: Refactor run-ocsp-responder.sh to use activate-ocspvenv.sh (#1391) 2022-12-15 09:15:01 -05:00
Andreas Braun
5f3503c01c PHPC-2165: Expose server error replies in BulkWriteResult (#1385) 2022-12-06 08:18:16 +01:00
Jeremy Mikola
a0b5fc1f10 Bump to libmongoc to 1.24-dev to fix Windows builds (#1389) 2022-12-01 09:15:49 -05:00
Jeremy Mikola
6a7a2ba546 Bump to libmongoc to 1.24-dev (#1388)
* Update expected output for libmongoc 1.24-dev

See mongodb/mongo-c-driver@40a64c2ffd

* Require C99 when compiling
2022-11-30 03:06:12 -05:00
Andreas Braun
0198c9fd5e Merge branch 'v1.15'
* v1.15:
  PHPC-2169: Stop testing on Appveyor (#1386)
2022-11-29 10:19:22 +01:00
Andreas Braun
bbc1c01afc PHPC-2169: Stop testing on Appveyor (#1386)
* PHPC-2169: Stop testing on Appveyor

* Remove Appveyor badge from Readme
2022-11-29 10:16:25 +01:00
Jeremy Mikola
ab400ecdb9 Revise release instructions (#1384)
Push "Package X.Y.Z" and "Back to -dev" commits separately to ensure Windows build artifacts are created for the tag.

Add instructions for creating a maintenance branch after releasing a new minor version.

* Use diff code blocks for more concise examples

* Apply syntax highlighting to release notes examples

Co-authored-by: Andreas Braun <alcaeus@users.noreply.github.com>
2022-11-23 05:13:47 -05:00
Jeremy Mikola
a86a162956 Master is now 1.16-dev 2022-11-23 11:12:56 +08:00
Jeremy Mikola
1c30be03dd Back to -dev 2022-11-23 11:11:23 +08:00
Jeremy Mikola
7a73cdfd43 Package 1.15.0 1.15.0 2022-11-23 10:50:05 +08:00
Jeremy Mikola
51f0dd5399 PHPC-2143: Build Windows DLLs with GitHub Actions (#1380)
* Fix APM and CSFLE tests for Windows CI

* Add Windows to GitHub CI and build DLLs for releases

* Add --enable-debug-pack configure opt to generate PDB files

* Reminder to check for Windows build artifacts before publishing releases

* Revise advice on publicizing releases
2022-11-21 10:09:46 -05:00
Jeremy Mikola
4f7f14d932 PHPC-2168: Use consistent int types for APM fields and snprintf (#1383)
The buffer for snprintf is slightly larger than necessary (21 bytes), but this is consistent with the buffer size we use elsewhere.
2022-11-16 04:22:11 -05:00
Jeremy Mikola
b83ab98376 PHPC-2166: Add -Wstrict-prototypes dev build flag and fix decl (#1382) 2022-11-14 10:43:33 -05:00
Jeremy Mikola
594cad9a30 PHPC-2083: Revise BSON handling of enum classes
Revert previous enum instantiation behavior and PersistableEnum trait from de5f1e5a93

Backed enums will be encoded as their case value. Non-backed cannot be encoded and no enums can be encoded at the root level.

Prohibit enums from implementing Persistable and Unserializable.
2022-11-10 20:21:36 +08:00
Jeremy Mikola
7423da41aa PHPC-2159: Consider enums and traits in BSON decoding instantiatable checks
Prohibit uninstantiatable classes in type maps, and ignore them when processing __pclass fields.

Utilize zend_get_object_type_case from PHP 8.2 for more helpful error messages in php_phongo_bson_state_fetch_class.
2022-11-10 20:21:36 +08:00
Jeremy Mikola
889d536ff8 Backport zend_get_object_type_case functions from PHP 8.2
See: php/php-src@733023b2e3
2022-11-10 20:21:35 +08:00
Jeremy Mikola
e3d1d37e42 PHPC-2153: Add PHP 8.2 to Evergreen matrix (#1379) 2022-11-01 23:52:44 -04:00
Andreas Braun
b0b1fd1b94 PHPC-2146: Refactor typemap struct and BSON encoding/decoding of zvals (#1369)
* Avoid re-parsing bson when converting to zval

A lot of occurrences start out with a bson_t*, then call bson_get_data on it to pass it to php_phongo_bson_to_zval_ex. This however creates a new bson reader and creates a new bson_t* from the given data. This is unnecessary and we should pass the original bson_t* in these instances.

* Refactor typemap struct

* Extract object initialisation from document visitor

* Refactor document and array visitors

* Fix wrong signature in array visitor declaration

* Rename ce member for consistency

* Add exception thrown comment

* Fix clang-format
2022-10-24 12:22:18 +02:00
Andreas Braun
ae18d5ccab Bump to libmongoc 1.23.1 (#1377) 2022-10-21 13:11:07 +02:00
Andreas Braun
16cce7f0b5 PHPC-2147: Clone PHP fork of Windows SDK on Appveyor (#1376) 2022-10-21 13:10:29 +02:00
Remi Collet
d495e1eb91 protect message to allow comma (#1375) 2022-10-21 12:55:33 +02:00
Jeremy Mikola
b30c723ed2 Merge branch 'v1.14' 2022-10-20 23:23:20 +08:00
Jeremy Mikola
d8515fd9ed Back to -dev 2022-10-20 23:22:17 +08:00
Jeremy Mikola
0c0c995500 Package 1.14.2 1.14.2 2022-10-20 23:00:08 +08:00
Jeremy Mikola
dadb93fb34 Merge branch 'v1.14'
v1.14 pointed to libmongoc 1.14.2, which was released some time after the submodule target in the master branch (a dev commit before libmongoc 1.23.0). To resolve this conflict, the libmongoc submodule has been bumped to 1.23.0.

Note: a libmongoc 1.23.1 tag also exists, but that bump can be done in a subsequent PHPC ticket related to the libmongoc changes therein.

This also adds a section to CONTRIBUTING.md to provide guidance on resolving submodule merge conflicts.
2022-10-20 21:44:20 +08:00
Jeremy Mikola
e853c4c0e6 PHPC-2157: Bump pkg-config requirement and libmongoc-version matrix to 1.22.2
This was missed in 0a23d0a94b
2022-10-20 20:51:55 +08:00
Jeremy Mikola
0a23d0a94b PHPC-2157: Upgrade libmongoc to 1.22.2 (#1374) 2022-10-20 13:21:56 +02:00
Andreas Braun
9ee40509e5 PHPC-2154: Test PHP 8.2 on Appveyor (#1372)
* Invert build image config

* Update to latest PHP versions

* Add PHP 8.2.0RC4
2022-10-19 13:27:53 +02:00
Jeremy Mikola
57f8068f32 PHPC-2152: Link libresolv when detecting res_nsearch (#1371)
This fixes a bug inadvertently introduced in b581f2a3e4.
2022-10-18 22:25:43 -04:00
Jeremy Mikola
411a022bcd PHPC-2148: Prohibit masterKey without provider for rewrapManyDataKey 2022-10-14 16:48:59 +08:00
Jeremy Mikola
d060b94c2d PHPC-2151: Validate masterKey option in createDataKey() and rewrapManyDataKey() 2022-10-14 16:48:59 +08:00
Jeremy Mikola
da5e12cc42 PHPC-2149: Ensure masterKey bson_t is freed in createDataKey() 2022-10-14 16:48:59 +08:00
Jeremy Mikola
24c3ccdf1c Fix doc comment for rewrapManyDataKey
Revises original comment from c99a8563bf
2022-10-14 16:02:05 +08:00