457 Commits

Author SHA1 Message Date
Jeremy Mikola
94ee50e5ef PHPC-1004: Rename ObjectID to ObjectId 2017-08-30 10:12:22 -04:00
Jeremy Mikola
a5fe81bd06 PHPC-640: Revert TypeWrapper interface 2017-08-28 17:54:55 -04:00
Jeremy Mikola
58324ad627 PHPC-992: Rename extended JSON functions to[Canonical|Relaxed]ExtendedJSON() 2017-08-10 12:56:47 -04:00
Jeremy Mikola
ce328f1a89 PHPC-887: Throw for unexpected types in URI options array
Note: generic boolean options (e.g. "ssl") will continue to accept non-boolean types for BC, since we cast via bson_iter_as_bool(). However, RP and WC-specific boolean options (e.g. "slaveOk", "journal") will throw since they previously silently ignored non-boolean values.

In addition to revising read preference tests, this adds new tests for read concern and write concern options.
2017-08-08 09:41:47 -04:00
hassan
c3310143f3 PHPC-887: Throw for unexpected readPreference URI option type 2017-08-04 10:59:35 -04:00
Jeremy Mikola
3b171c795e PHPC-846: Throw if maxStalenessSeconds URI option is out of range 2017-08-04 10:54:44 -04:00
Jeremy Mikola
36487bc0a9 PHPC-640: Create interfaces for BSON types classes
These interfaces are implemented by the corresponding BSON classes and intended to be used by TypeWrapper implementations.
2017-08-03 11:18:56 -04:00
Jeremy Mikola
65f5091010 PHPC-941: Add MongoDB\BSON\toCanonicalJSON() and toRelaxedJSON()
In CDRIVER-2208, bson_as_json() (used by toJSON()) was reverted to its original output format. Canonical and relaxed extended JSON are now produced by bson_as_canonical_json() and bson_as_relaxed_json(), respectively. This commit removes toExtendedJSON() (added in 980f1fb01a) in favor of the new functions.

Implementations for the BSON functions have been moved to their own file, which is consistent with what we're doing for the APM subscriber functions.
2017-07-28 13:30:06 -04:00
Jeremy Mikola
054af9419f PHPC-983: Add arg info for MongoDB\BSON\toPHP()'s type map parameter 2017-07-28 10:29:50 -04:00
Jeremy Mikola
9cbd82b458 Specify object class in arginfo for APM functions 2017-07-26 14:03:46 -04:00
Jeremy Mikola
c79f57c1de PHPC-981: Move APM functions to MongoDB\Driver\Monitoring namespace 2017-07-26 14:02:10 -04:00
Jeremy Mikola
e089c2bd01 PHPC-950: Skip APM callbacks if subscriber HashTable is uninitialized 2017-07-25 15:32:31 -04:00
Jeremy Mikola
d8541658ad PHPC-839: Support maxAwaitTimeMS Query option for tailable await cursors 2017-05-24 20:29:11 -04:00
Jeremy Mikola
22308a6d1e PHPC-959: mongoc_collection_find_with_opts() always returns a cursor 2017-05-08 12:23:28 -04:00
Jeremy Mikola
ee613c214c PHPC-628: Throw InvalidArgumentException when executing empty BulkWrite 2017-05-08 12:21:03 -04:00
Jeremy Mikola
773d36450e PHPC-772: Parse authMechanism options in URI options array 2017-04-26 11:48:35 -04:00
Jeremy Mikola
8f1da9d343 Extract php_phongo_apply_options_to_uri() from php_phongo_make_uri() 2017-04-26 11:48:35 -04:00
Jeremy Mikola
bc9c266a78 PHPC-953: Do not parse "database" key in URI options array
This option was never documented and is redundant in light of the "authSource" option.
2017-04-26 11:48:35 -04:00
Jeremy Mikola
a13e118214 PHPC-957: Use libmongoc constants for applicable URI options 2017-04-26 11:48:35 -04:00
Jeremy Mikola
277df7ebee PHPC-640: TypeWrapper interface 2017-04-26 11:23:26 -04:00
Derick Rethans
980f1fb01a PHPC-941: Add MongoDB\BSON\toExtendedJSON() to wrap bson_as_extended_json() 2017-04-07 14:54:54 -04:00
Jeremy Mikola
2b9bf755e0 Merge branch 'v1.2' 2017-04-07 12:15:47 -04:00
Jeremy Mikola
c8f6bad103 Create PHP 5.x compatibility macro for ZVAL_UNDEF 2017-04-07 11:16:58 -04:00
Jeremy Mikola
175e3b3d45 PHPC-944: Translate MONGOC_ERROR_COMMAND_INVALID_ARG to InvalidArgumentException 2017-03-31 12:13:01 -04:00
Jeremy Mikola
9db86130e7 Use static decl for phongo_writeresult_init() 2017-03-31 13:44:46 +01:00
Jeremy Mikola
4a18dd9877 Fix typo 2017-03-31 13:44:46 +01:00
Jeremy Mikola
1b68c3add0 Use ZEND_STRL() macro in php_phongo_command_failed() 2017-03-31 13:44:46 +01:00
Jeremy Mikola
f5f9433afc Remove local variable in APM callbacks 2017-03-31 13:44:46 +01:00
Jeremy Mikola
49422c420c Refactor php_phongo_dispatch_handlers() to a single #if block 2017-03-31 13:44:46 +01:00
Jeremy Mikola
83fed0b6d9 Alphabetize lists of Monitoring classes 2017-03-31 13:44:46 +01:00
Derick Rethans
77a68728e2 PHPC-349: Implement APM specification 2017-03-31 13:44:46 +01:00
Jeremy Mikola
321fd72881 PHPC-942: Use mongoc_uri_new_with_error() to improve URI error reporting 2017-03-28 15:58:48 -04:00
Jeremy Mikola
9b18a2adc3 Merge branch 'v1.2' 2017-03-20 09:29:05 -04:00
Jeremy Mikola
f4cea432a9 PHPC-936: Define PHP_MONGODB_VERSION and STABILITY constants
This removes the redundant MONGODB_VERSION constant renames the existing version and stability constants to be consistent with the format in PHP's extension skeleton: dcfd753104
2017-03-17 14:47:21 -04:00
Jeremy Mikola
ff7a211cc0 PHPC-932: Remove reference to Manager on Cursor, Server, and WriteResult
This reverts changes introduced in PHPC-671, which are no longer necessary due to mongoc_client_t persistence (PHPC-433).
2017-03-10 09:50:37 -05:00
Jeremy Mikola
7626beaa1d Refactor php_format_date() call in php_phongo_log()
Since we never check time()'s return value for an error (on par with PHP internals), we can simply pass it to php_format_date(). Also, the ZEND_STRL() macro allows us to remove the duplicate format string provided we still cast the first argument.
2017-03-10 09:49:48 -05:00
Jeremy Mikola
a5697c679c PHPC-930: Log instead of throwing exceptions for critical/error levels 2017-03-10 09:49:48 -05:00
Jeremy Mikola
f55236b4f1 PHPC-875: Allow compiling without SSL 2017-03-10 09:48:25 -05:00
Jeremy Mikola
14581e87a2 Merge branch 'v1.2' 2017-03-10 09:47:37 -05:00
Jeremy Mikola
5864a6306d PHPC-931: Ensure php_phongo_pclient_t is freed during MSHUTDOWN 2017-03-10 09:46:45 -05:00
Jeremy Mikola
62f9487fcd Merge branch 'v1.2' 2017-03-06 12:18:35 -05:00
Jeremy Mikola
06778c6928 PHPC-901: False slaveOk URI option should be ignored 2017-03-06 12:14:44 -05:00
Jeremy Mikola
600db56bd8 PHPC-912: Do not destroy persisted clients created by other processes 2017-03-06 12:13:33 -05:00
Jeremy Mikola
3b999733fd Merge branch 'v1.2' 2017-02-14 12:55:55 -05:00
Jeremy Mikola
b55ea81fd6 PHPC-913: Child process should not re-use mongoc_client_t objects from parent 2017-02-13 17:21:39 -05:00
Jeremy Mikola
12e2ee6294 PHPC-911: Use prefixed symbols for shared construct/wakeup FEs 2017-02-10 15:56:12 -05:00
Jeremy Mikola
bdb75791ab PHPC-911: Prefix Zend_FN names for MongoDB\BSON functions 2017-02-10 15:56:12 -05:00
Jeremy Mikola
b75c5ffb66 PHPC-910: Split BSON encoding/decoding and prefix symbols 2017-02-10 15:56:12 -05:00
Jeremy Mikola
99f0f39386 Remove unused _phongo_debug_bson() function 2017-02-10 15:56:12 -05:00
Jeremy Mikola
7debc8a43e PHPC-908: Do not declare MINIT functions for each driver class 2017-02-10 15:56:12 -05:00