Commit Graph

3944 Commits

Author SHA1 Message Date
Jeremy Mikola
66fc49354d PHPC-2096: Implement Manager::getEncryptedFieldsMap()
PHPLIB will need to access the encryptedFieldsMap autoEncryption option.
2022-05-31 18:59:22 -04:00
Jeremy Mikola
1b8543b42f PHPC-2092: ClientEncryption options for queryable encryption
Several new constants for these options have been introduced.
2022-05-31 18:59:22 -04:00
Jeremy Mikola
52f014bc8f PHPC-2085: autoEncryption options for queryable encryption 2022-05-31 18:59:22 -04:00
Jeremy Mikola
2e561ad420 Bump libmongoc and libmongocrypt submodules 2022-05-31 18:59:22 -04:00
Jeremy Mikola
f97f3efaea PHPC-2094: Relay command comment when constructing a cursor (#1322) 2022-05-24 18:52:07 -04:00
Aleksandr Rudo
8823d1f5ae PHPC-2086: Add MongoDB 6.0 to GitHub CI matrix (#1323) 2022-05-24 14:40:54 -04:00
Jeremy Mikola
b73afcd482 PHPC-2053: Remove mongodb.mock_service_id INI option
Note: this was only used for internal testing and should not be considered a BC break.
2022-05-23 13:55:40 -04:00
Jeremy Mikola
163d91076e PHPC-2090: Add MongoDB 5.0 to load balancer CI matrix 2022-05-23 13:55:40 -04:00
Jeremy Mikola
db4fe3dc8b PHPC-2049: BulkWrite and Query support comment option of any type (#1320)
* PHPC-2049: Bump libmongoc and libmongocrypt submodules

libmongoc master (1.22-dev) now depends on libmongocrypt master (1.5-dev).

libmongoc's bundled zlib library was updated to 1.2.12.

* PHPC-2049: BulkWrite and Query support comment option of any type

MongoDB 4.4+ allows a comment option of any type on most commands. Previously, find required a string type and write commands did not support comment at all. The driver does not validate the option and relies on the server to raise an error.

* Fix title and variable access in BulkWrite and Query let option tests

* Fix grammar in php_phongo_bulkwrite_delete_apply_options comment

* Undefine additional Query option macros
2022-05-20 11:11:18 -04:00
Jeremy Mikola
11ae405244 PHPC-2088: Fix memory leak in php_phongo_zval_to_bson_value
The bson_t used to hold the intermediary result between zval conversion and bson_value_t extraction must be freed.

This also refactors the function to use a stack-allocated zval for the data envelope.
2022-05-18 14:46:48 -04:00
Jeremy Mikola
035cb9d6a5 PHPC-2089: Fix bson_value_t memory leaks in ClientEncryption methods 2022-05-18 14:46:48 -04:00
Jeremy Mikola
dc3973d0a8 PHPC-1899: getServerConnectionId for command monitoring events (#1316) 2022-04-29 10:06:04 -04:00
Jeremy Mikola
98727aee85 PHPC-2005: Support 'let' option for multiple CRUD commands (#1312) 2022-03-31 17:03:57 -04:00
Jeremy Mikola
4f576deeb5 Master branch is now 1.14-dev 2022-03-23 13:20:23 -04:00
Jeremy Mikola
b396cf4f89 Back to -dev 2022-03-23 12:52:24 -04:00
Jeremy Mikola
ac609b16bd Package 1.13.0 1.13.0 2022-03-23 12:51:09 -04:00
Jeremy Mikola
33e2e903fe Bump lowest-supported libmongoc-version in Evergreen config 2022-03-23 12:19:29 -04:00
Jeremy Mikola
82aef8fae9 PHPC-2031: Upgrade libmongoc to 1.21.1 and libmongocrypt to 1.3.2 (#1306) 2022-03-23 12:11:45 -04:00
Jeremy Mikola
573415b008 PHPC-2074: Document test suite env vars and revise Mongo Orchestration notes (#1307) 2022-03-04 13:38:11 -05:00
Jeremy Mikola
d40302333a Fix ServerHeartbeatSucceededEvent::getReply proto 2022-03-03 14:38:33 -05:00
Jeremy Mikola
a33eb38f31 Replace curly quotes in proto comments 2022-03-02 10:15:08 -05:00
Jeremy Mikola
93efe0aeb6 PHPC-2073: Remove references to pre-3.6 servers (#1305)
* Remove pre-3.6 server versions from Evergreen matrix

* Remove skipped tests for pre-3.6 servers

* Remove old mongo-orchestration configs and Evergreen tasks

* Remove flaky replica set tests

These tests assume a particular replica set member is always the primary, so tag assertions may fail if a different member is elected. The server-getTags-002.phpt test has more flexible assertions for replica set tags, so we can safely remove these tests.
2022-03-01 20:30:00 -05:00
Jeremy Mikola
a25525e1ed Merge branch 'v1.12' 2022-02-22 16:24:13 -05:00
Jeremy Mikola
1d57e289f9 Back to -dev 2022-02-22 16:23:46 -05:00
Jeremy Mikola
05a6ab1ed0 Package 1.12.1 1.12.1 2022-02-22 16:23:01 -05:00
Jeremy Mikola
1ce10adcb3 Merge branch 'v1.12' 2022-02-22 16:06:41 -05:00
Jeremy Mikola
34d4adc472 PHPC-2071: Bump pkg-config requirements for libmongoc 2022-02-22 16:03:31 -05:00
Jeremy Mikola
ad53cfa167 PHPC-2071: Upgrade libmongoc to 1.20.1 (#1304) 2022-02-22 13:04:58 -05:00
Jeremy Mikola
d8feba4bd1 PHPC-2038: Init zval in phongo_clientencryption_init (#1303) 2022-02-15 15:59:49 -05:00
Jeremy Mikola
6fab43c933 Merge pull request #1282 2022-02-10 13:21:12 -05:00
Jeremy Mikola
220541ac3c Skip test pending libmongoc segfault fix (CDRIVER-4290) 2022-02-10 13:20:52 -05:00
Jeremy Mikola
2db00e0e24 PHPC-2064: Call skip_if_not_clean after other skip functions
"nocache" output from skip_if_not_clean may cause "skip" output from other functions to be ignored. Changing the order so that skip_if_not_clean is always called last will fix this in most cases (excluding tests that call skip_if_not_clean multiple times).
2022-02-10 13:20:52 -05:00
Jeremy Mikola
03d8858bff PHPC-2013: Upgrade libmongoc to 1.21.0
Pulls in changes from CDRIVER-4237

Also addresses min/maxWireVersion bumps for PHPC-1909 and PHPC-2034.
2022-02-10 13:20:22 -05:00
Jeremy Mikola
f681a0bd2f PHPC-2047: Update load balancer testing config (#1300)
* PHPC-2047: Update load balancer testing config

Upstream changes in drivers-evergreen-tools now require passing LOAD_BALANCER to run-orchestration.sh. Additionally, service ID mocking is no longer required as of server version 5.1.

* Add missing live server checks in tests
2022-02-03 14:49:19 -05:00
Jeremy Mikola
f5b5ef25c5 PHPC-2042: Remove conditional win32/time.h include (#1299)
This dates back to 29a372916c but should no longer be necessary as of 6eaa91b87b, which switched gettimeofday() to the libbson compat function.
2022-02-02 16:06:13 -05:00
Jeremy Mikola
d4be63cda3 PHPC-2036: Sync causal consistency tests (#1298)
Synced with mongodb/specifications@568093ce7f

Adds missing prose test 7 and removes prose test 10. This also adds prose test references to all files.
2022-01-26 20:38:42 -05:00
Jeremy Mikola
0960a204b3 PHPC-2037: Remove vim modeline comments 2022-01-26 20:31:48 -05:00
Jeremy Mikola
fc358d6f18 PHPC-2040: Break down php_phongo.c into smaller files
This also cleans up header includes throughout the project. The order follows: libbson, libmongoc, libmongocrypt, PHP, contrib (e.g. PHP array API), internal modules (e.g. php_phongo.h, phongo_bson.h), and class headers. Quoted strings are used for all but PHP includes, which are always sourced from system directories.

php_phongo.h is now responsible for including config.h and assigning the default logging domain.
2022-01-26 20:31:48 -05:00
Jeremy Mikola
2710b2ce00 PHPC-2039: Remove disabled debugging code 2022-01-26 20:31:48 -05:00
Jeremy Mikola
17b4a343fa Remove obsolete function declaration
This function was removed in 324182a8e6
2022-01-26 20:31:48 -05:00
Jeremy Mikola
5d97f64080 PHPC-1805: Remove redundant function declaration
This was introduced in 10b3a1fe70, but was redundant due to the subsequent macro definition.
2022-01-24 13:34:10 -05:00
Jeremy Mikola
ebfb7b2b85 PHPC-2028: Replace PHONGO_ALLOC_OBJECT_T with zend_object_alloc (#1296)
zend_object_alloc was introduced in php/php-src@b72b1a4e4d for PHP 7.3+. For PHP 7.2, we define a macro providing the original behavior of PHONGO_ALLOC_OBJECT_T (slower dynamic memset).
2022-01-20 11:26:59 -05:00
Jeremy Mikola
4e69ea49f8 PHPC-2032: Concise debug output for ended sessions (#1295) 2022-01-20 11:26:09 -05:00
Jeremy Mikola
83521ad9f7 PHPC-2003: Implement Session::isDirty() (#1293) 2022-01-18 10:58:00 -05:00
Jeremy Mikola
bd757bbb2b PHPC-1342: Regression tests for duplicate keys (#1294) 2022-01-18 09:59:45 -05:00
Jeremy Mikola
c2410ab0e7 PHPC-2023 and PHPC-2030: Allow observation of events dispatched during client destruction (#1292)
* PHPC-2023: Allow observation of TopologyClosedEvent

Observation is only possible for non-persistent clients freed before RSHUTDOWN. This change also allows for reliable testing of ServerClosedEvent.

* PHPC-2030: Test observation of commands issued during client destruction

Command monitoring events can only be observed for non-persistent clients freed before RSHUTDOWN.
2022-01-14 10:08:12 -05:00
Jeremy Mikola
7d26cfcba7 PHPC-2022: Use mongoc_host_list in event structs (#1291)
Limit ServerHeartbeatFailedEvent test to non-auth standalone
2022-01-11 14:39:39 -05:00
Jeremy Mikola
10b3a1fe70 PHPC-1150: SDAM Monitoring (#1289)
* PHPC-1805: Implement ServerDescription class

* PHPC-1910: Implement Server::getServerDescription()

* PHPC-1934: Check for uninitialized intern in ServerDescription get_properties_hash

* PHPC-1925: Change ServerDescription::getType() to return a string

* PHPC-1891: Implement TopologyDescription class

* PHPC-1892: Implement SDAMSubscriber interface

* PHPC-1893: Implement SDAM event classes

* Revise server and topology event classes and tests

Use phongo_objectid_init in getTopologyId() methods. Report topologyId as an ObjectId in debug info. Report TopologyDescription servers as ServerDescription in debug info.

Copy parameters in phongo_serverdescription_init and phongo_topologydescription_init for consistency with other functions (e.g. phongo_readconcern_init). This also creates phongo_serverdescription_init_ex for when we want to skip copying in Server::getServerDescription().

* PHPC-1953: Add tests for debug handlers

* PHPC-1959: Utilize Manager::addSubscriber() in tests

Skip TopologyClosedEvent test (pending PHPC-2023)

* PHPC-1958: Assert same topologyId for SDAM events

* PHPC-2025: Support load balancer in ServerDescription and TopologyDescription

* PHPC-2026: Handle 64-bit lastUpdateTime for 32-bit platforms

Co-authored-by: Tanli Su <46271307+tanlisu@users.noreply.github.com>
Co-authored-by: Andreas Braun <git@alcaeus.org>
Co-authored-by: Tanli Su <tanli.su@gmail.com>
2022-01-10 13:14:10 -05:00
Jeremy Mikola
f62570c9fe Merge branch 'v1.12' 2022-01-10 13:05:22 -05:00
Jeremy Mikola
ded3db3128 PHPC-2027: Add PHP 8.1 to AppVeyor and bump older versions (#1290)
* PHPC-2027: Add PHP 8.1 to AppVeyor and bump older versions

* Swap order of checking for configureFailPoint
2022-01-10 13:05:03 -05:00