581 Commits

Author SHA1 Message Date
Remi Collet 6b0210999d PHPC-1551: Fix build with system libraries 2020-02-04 19:18:47 +01:00
Andreas Braun b8c8523e1c PHPC-1545: Improve checks for invalid encryption option types 2020-01-30 15:00:17 +01:00
Andreas Braun 78fb41572d PHPC-1540: Destroy persistent clients in reverse order to prevent segmentation faults 2020-01-27 20:35:47 +01:00
Andreas Braun 78638e019c PHPC-1539: Use mongoc error types over generic int 2020-01-27 19:31:39 +01:00
Andreas Braun 4a9eecfbd6 PHPC-1539: Introduce EncryptionException class 2020-01-27 19:31:39 +01:00
Andreas Braun f0372a50c5 PHPC-1499: Implement ClientEncryption::decrypt 2020-01-22 08:18:32 +01:00
Andreas Braun 4d7b35ee69 PHPC-1499: Implement ClientEncryption::encrypt 2020-01-22 08:18:32 +01:00
Andreas Braun e65a933c8f PHPC-1499: Implement ClientEncryption::createDataKey 2020-01-22 08:18:32 +01:00
Andreas Braun 4923bdd97b PHPC-1499: Add empty ClientEncryption class 2020-01-22 08:18:32 +01:00
Andreas Braun 08bac1e5ec PHPC-1498: Throw exception when configuring autoEncryption options without FLE 2020-01-16 09:23:25 +01:00
Andreas Braun 123f9b0b88 PHPC-1498: Read auto encryption options from driverOptions 2020-01-16 09:23:12 +01:00
Andreas Braun a19fdb0fbd PHPC-1500: Replace manager instance with client hash for hashing 2020-01-16 09:04:30 +01:00
Andreas Braun b65ee367cb PHPC-1500: Store client hash in manager struct 2020-01-16 09:04:29 +01:00
Jeremy Mikola 9ecb50a7e6 PHPC-1274: Reset client after forking for Cursor and Session
Check PID before creating/freeing a session or cursor to avoid interfering with resources owned by a parent process. Additionally, prohibit resetting a client multiple times to avoid cases where child resources may not be cleaned up.
2020-01-10 17:28:48 -05:00
Andreas Braun 94bb265ec9 Run clang-format on existing sources 2020-01-08 13:41:53 +01:00
Andreas Braun 7cea21a25a PHPC-1496: Add support for compiling with libmongocrypt 2020-01-08 12:41:41 +01:00
Jeremy Mikola 366dcbe7d2 PHPC-1411: Prefer integer types for wtimeout when possible
For serialization, 64-bit wtimeout values will always be encoded as strings for portability. Debug output and bsonSerialize() can always use integers on 64-bit platforms and can fall back to strings and Int64 objects on 32-bit platforms, respectively.
2019-12-19 06:51:06 +01:00
Andreas Braun cdff70faf6 PHPC-1411: Accept 64-bit integers for wTimeoutMS 2019-12-19 06:50:41 +01:00
Andreas Braun 20db35ac2d PHPC-1446: Implicitly enable TLS when any TLS-related driver option is set 2019-11-14 09:02:22 +01:00
Andreas Braun 0cee16306c PHPC-1472: Return status of php_phongo_server_to_zval 2019-11-07 07:16:49 +01:00
Andreas Braun 2f88011450 PHPC-348: Check for errors after calling bson_to_zval() 2019-10-28 15:37:12 +01:00
Andreas Braun fafe50330e PHPC-1074: Refactor php_phongo_bson_state initializers 2019-10-25 10:46:28 +02:00
Andreas Braun 5e53ac9aab PHPC-1430: Deprecate obsolete driver options 2019-10-25 10:45:51 +02:00
Andreas Braun bacb0feb55 PHPC-952: Move BSON type initiators to bson.c 2019-10-21 09:52:46 +02:00
Andreas Braun 0dbadbb4e8 PHPC-1347: Do not allow empty string for replicaSet 2019-10-21 07:39:13 +02:00
Andreas Braun 56a9f43ab6 PHPC-870: Use ZEND_HASH_FOREACH indirect macros where applicable 2019-10-17 15:56:38 -04:00
Andreas Braun 8b5553f66a PHPC-966: Explicitly initialize fields for internal class structs 2019-10-07 16:22:15 +02:00
Andreas Braun 4fa3d850a5 PHPC-991: Override safe and slaveok options correctly 2019-09-30 11:07:15 +02:00
Andreas Braun 42a674c9af PHPC-991: Handle duplicates in URI options array 2019-09-30 11:07:15 +02:00
Andreas Braun c1f3c909f1 Remove unnecessary parameter from php_phongo_make_uri 2019-09-30 11:07:15 +02:00
Andreas Braun d03f36227e PHPC-1290: Adapt server selection logic to respect session pinning 2019-08-28 20:10:46 +02:00
Andreas Braun ef16f97f6c PHPC-1288: Add checks for conflicting TLS options 2019-08-28 07:34:07 +02:00
Andreas Braun df587dd08d PHPC-1288: Apply TLS driver options to URI options 2019-08-28 07:34:07 +02:00
Andreas Braun 2f94d957ca PHPC-1346: Do not allow empty string for username 2019-08-26 12:31:52 +02:00
Jeremy Mikola 8bc8be556f PHPC-1369: Upgrade libmongoc to 1.15-dev
Use int64_t API for wTimeoutMS. The initial commit for CDRIVER-3087 deprecated the int32_t API for wTimeoutMS. Migrate to the int64_t API to avoid deprecation warnings. Note: PHPC (and libmongoc's URI parsing) still require 32-bit values for wTimeoutMS, so this does not affect users. Having said that, PHPC-1411 may introduce support for 64-bit values and necessitate changes to the code where we read wTimeoutMS values.

Use mongoc_uri_get_tls to read tls/ssl URI option. As part of CDRIVER-2869, libmongoc deprecated mongoc_uri_get_ssl and introduced a "tls" alias. Migrate to the new API to avoid deprecation warnings.

Expect lowercase URI option in error. As part of CDRIVER-2869, libmongoc does case-folding on option keys to facilitate deduplication.
2019-07-23 09:38:17 -04:00
Jeremy Mikola 1f5a63073d PHPC-1387: 1.6.0-dev code fixes after merging v1.5 branch
This fixes a few things related to 04b1cc3e14
2019-05-31 13:10:16 -04:00
Jeremy Mikola 845edf6867 Merge branch 'v1.5' 2019-05-31 10:09:16 -04:00
Jeremy Mikola 04b1cc3e14 PHPC-1387: Consider error document for cursor exceptions
This allows executeQuery() to throw a CommandException, which exposes the error document.

In 1.6+, it will also ensure that error labels are set on any RuntimeException thrown during cursor iteration, which is relevant for transactions.
2019-05-30 13:58:29 -04:00
Jeremy Mikola 092d82dd95 Relocate "_t" in function name 2019-05-30 12:30:04 -04:00
Jeremy Mikola cad8292e35 PHPC-1373: Accessible WriteResult for executeBulkWrite socket error
executeBulkWrite() will now throw a BulkWriteException on top of any previous exception to ensure that a WriteResult can be attached. InvalidArgumentException is excluded, since that is only thrown before mongoc_bulk_operation_execute does IO (e.g. batch is empty).
2019-05-15 14:27:16 -04:00
Jeremy Mikola abbabaf360 Remove unreachable code (per Coveralls)
This condition was never reached. Apart from code coverage, it's clear that an exception would not be thrown before this point since only libmongoc functions are called.
2019-05-14 14:21:27 -04:00
Derick Rethans 74064e427c PHPC-1271: Add (only) RHEL on zSeries to Evergreen Matrix 2019-02-14 15:35:31 -05:00
Derick Rethans a73187c5b5 PHPC-1123: Create interface for Cursor class 2018-10-09 14:16:38 +01:00
Derick Rethans 55eb5b3f03 Fixed clang-format issues 2018-10-03 10:57:43 +01:00
Derick Rethans d07d180dd6 Merge branch 'v1.5' 2018-09-20 18:14:16 +01:00
Derick Rethans 3624e5acfd PHPC-1272: phongo_execute_query() should not alter state of Query opts 2018-09-20 17:37:09 +01:00
Derick Rethans f6e8d659e2 Merge branch 'v1.5' 2018-09-20 10:50:29 +01:00
Derick Rethans 26d276407e PHPC-1270: Upgrade libmongoc to 1.13.0 2018-09-20 10:49:49 +01:00
Derick Rethans 938ba02fd2 Merge branch 'v1.5' 2018-08-30 11:59:10 +01:00
Derick Rethans ee1d425e69 PHPC-1225: Add test to catch unsupported server wire protocol versions 2018-08-30 11:58:46 +01:00