551 Commits

Author SHA1 Message Date
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
Derick Rethans b795892b2a Merge branch 'v1.5' 2018-07-31 11:04:27 +01:00
Derick Rethans f645aad242 PHPC-1239: Passing SSL driversOptions to Manager constructor overrides SSL options in URI 2018-07-31 11:04:16 +01:00
Derick Rethans c5f82b714c PHPC-1229: Populate error labels for bulk write exceptions 2018-07-17 16:59:09 +01:00
Derick Rethans 6b2e387de1 PHPC-1222: Implement accessor for error labels on exception classes 2018-07-02 13:52:49 +01:00
Jeremy Mikola 98a7abaa21 PHPC-1216: Always validate and apply wtimeoutMS in URI options array 2018-06-25 16:19:16 -04:00
Jeremy Mikola 9f118a2229 PHPC-1211: Int64 class to wrap 64-bit integers on 32-bit platforms 2018-06-22 13:07:33 -04:00
Derick Rethans 1c19860103 PHPC-1193: Upgrade bundled libbson and libmongoc to 1.11 2018-06-19 20:07:48 +01:00
Derick Rethans b172a20c31 PHPC-1140: Implement Transactions specification 2018-06-19 14:47:29 +01:00
Derick Rethans f12e2005b4 PHPC-850: var_export() support for ReadPreference 2018-06-07 17:08:22 +01:00
Derick Rethans ab1f151e04 PHPC-1193: Bump libmongoc to 1.11 (and add ICU check) 2018-06-07 16:40:22 +01:00
Katherine Walker 814d49cacf PHPC-1076: Expose result document for failed commands via CommandFailedEvent 2018-05-22 08:31:01 -04:00
Katherine Walker 5e219a29b8 PHPC-1149: php_phongo_dispatch_handlers() should break if exception is thrown 2018-04-27 14:06:22 -04:00
Katherine Walker 7b4cb0c30e PHPC-1160: Initialize bson_error_t structs to zero 2018-04-26 15:31:14 -04:00
Jeremy Mikola 9fd2f10dfa Merge branch 'v1.4' 2018-04-24 13:47:29 -04:00
Jeremy Mikola cceeda84c1 PHPC-1163: Prohibit session with unacknowledged write concern
This adds checks to ensure that explicit sessions and unacknowledged write concerns (explicit or inherited) will not be mixed when executing bulk writes or commands. Additionally, we ensure that command execution does not create its own implicit session (per PHPC-1152) if the effective write concern is unacknowledged.

Note: libmongoc still needs to ensure that it does not create implicit sessions for unacknowledged commands (CDRIVER-2615).
2018-04-24 13:18:53 -04:00
Jeremy Mikola 58030116dd Apply code formatting to changes from v1.4 2018-04-18 16:17:45 -04:00
Jeremy Mikola 480bc58cd3 Merge branch 'v1.4' 2018-04-18 16:08:00 -04:00
Jeremy Mikola 427854e092 PHPC-1152: Create implicit session for commands
This ensures that phongo_execute_command creates an implicit session (if supported and not explicit session was provided). In turn, this ensures that any command cursor shares the same session as its originating command.

By creating a Session object, we can ensure that the implicit session is destroyed during garbage collection when the last reference is removed.
2018-04-18 14:36:39 -04:00
Jeremy Mikola aec79b2f12 Refactor command and query execute functions
This corrects the function signatures to return a boolean indicating success instead of an integer (which was cast from a boolean).

Additionally, it restructures phongo_execute_command() to use a cleanup label, in anticipation of implicit session changes.
2018-04-18 13:37:58 -04:00
Jeremy Mikola c154b49444 PHPC-578: phongo_execute_command() should still throw ExecutionTimeoutException
This fixes an inadvertent side effect of 4b70d9b9de.
2018-04-16 17:03:29 -04:00
Jeremy Mikola 230d8d9ab2 Define constant for ExceededTimeLimit server error 2018-04-16 17:03:29 -04:00
Jeremy Mikola 3af46fc79c Merge branch 'v1.4' 2018-04-16 11:32:51 -04:00
Jeremy Mikola 21307dee76 PHPC-1151: Maintain Session reference on Cursor
This ensures that the Session and underlying mongoc_client_session_t will not be freed until after the Cursor's mongoc_cursor_t object is destroyed.
2018-04-16 11:28:21 -04:00
Jeremy Mikola 06f608059e Move up client argument for phongo_parse_session()
Client is required, while the opts and zval arguments are optional.
2018-04-16 11:16:21 -04:00
Katherine Walker 3125be38ca PHPC-1148: Remove PHONGO_ERROR_WRITE_FAILED 2018-04-12 10:20:58 -04:00
Katherine Walker b829ec543f PHPC-1148: Throw InvalidArgumentException if BulkWrite is executed multiple times 2018-04-10 16:19:58 -04:00
Katherine Walker 4b70d9b9de PHPC-578: Expose result document for failed commands 2018-03-27 16:49:44 -04:00
Katherine Walker 110d13e4b3 PHPC-1090: Remove redundant MONGOC_ERROR_COMMAND check 2018-03-22 17:37:32 -04:00
Katherine Walker 8e0e836913 PHPC-1144: Use server-side error code for BulkWriteException 2018-03-22 17:37:32 -04:00
Katherine Walker 5d2f12b988 PHPC-1143: Select ServerException for MONGOC_ERROR_WRITE_CONCERN domain 2018-03-22 14:49:47 -04:00