Jeremy Mikola
f37f589bbc
PHPC-783: Use mongoc_collection_find_with_opts() for Query exec
...
Query struct fields have been consolidated to a filter and opts BSON documents.
This also changes the Query debug output significantly.
2016-09-20 16:57:20 -04:00
Jeremy Mikola
0160871af6
PHPC-752: Validate range of maxStalenessMS Manager option
...
This also adds various tests for parsing of read preference Manager options.
2016-09-19 16:54:48 -04:00
Jeremy Mikola
77209dd65d
PHPC-752: Add maxStalenessMS to ReadPreference class
...
This adds an options array to the ReadPreference constructor, which accepts a maxStalenessMS option. The option is also exposed via a getter method and in debug output.
2016-09-19 16:54:48 -04:00
Jeremy Mikola
467b981f95
Move (char *) casting to ADD_ASSOC_STRING macro
...
This is necessary since PHP's add_assoc_string_ex() declares the argument as char *, even though it never modifies the string contents and later assigns it to a const char * internally. Since we always duplicate the string for PHP 5.x and it is never modified in PHP 7, there is no harm in this cast.
2016-09-19 16:13:05 -04:00
Derick Rethans
8f9e6c8c53
PHPC-498: ReadPreference, ReadConcern, and WriteConcern should serialize to BSON
2016-09-19 20:33:14 +01:00
Jeremy Mikola
56d8b77b15
PHPC-424: Validate that RP tag set is an array of documents
...
This adds common validation for read preference tag sets when specified through either the Manager constructor's URI options array or ReadPreference constructor.
An additional test case for a malformed tag set has been added to the Manager::__construct() error test for read preference options. Additionally, the ReadPreference::__construct() error test has been split up to test for mode and tagSet errors separately.
Note: we cannot test for the exceptions for bson_init_static() and mongoc_read_prefs_is_valid(), since those points will never be hit in normal operation.
2016-09-15 12:40:27 -04:00
Derick Rethans
2cbbd69404
PHPC-786: Support appname in URI array options
2016-09-14 18:21:13 +01:00
Jeremy Mikola
8fbf0fa4db
PHPC-605: Remove unused php-ssl.c contrib code
2016-09-14 10:29:36 -04:00
Jeremy Mikola
9717d5cac6
PHPC-605: crl_file is not supported by LibreSSL or Secure Transport
2016-09-08 11:10:35 -04:00
Jeremy Mikola
a5667e6c9a
PHPC-605: Split exceptions for unsupported ca_dir and capath options
2016-09-08 11:10:34 -04:00
Jeremy Mikola
3036797f41
Use consistent memory allocation for write error messages
...
These strings were released with efree() in the object destructors and should be allocated with emalloc().
2016-09-08 11:10:34 -04:00
Jeremy Mikola
29e5121cb7
PHPC-433: Persist mongoc_client_t objects in a HashTable
...
Clients will be hashed by Manager constructor arguments. Since they must persist between requests, the Manager destructor will no longer free the client and we'll need to start using persistent memory allocation for libbson and libmongoc.
2016-09-08 11:10:34 -04:00
Jeremy Mikola
1060cb8ba4
PHPC-433: Refactor phongo_manager_init() option handling
...
BSON conversion of uriOptions moves to phongo_manager_init(). Merging of stream context options into driverOptions and removal of the context resource is now done in the Manager constructor.
phongo_manager_init() now has zvals for both uriOptions and driverOptions and will be able to serialize them with the URI string for a client hash.
2016-09-07 18:08:19 -04:00
Jeremy Mikola
e5db9dd2ff
PHPC-605: Fix exception logic for unsupported ca_dir option
2016-09-07 18:08:19 -04:00
Jeremy Mikola
c673e0aee2
PHPC-704: Do not set mongodb.debug from driver options
...
The mongodb.debug INI option is a global setting and should not be set based on a single Manager's constructor argument.
2016-09-07 18:08:19 -04:00
Derick Rethans
0ab5d5c74c
PHPC-752: Allow users to set a limit on acceptable staleness
2016-08-31 14:41:58 -04:00
Derick Rethans
91aaf65b9d
PHPC-757: Implement The MongoDB Handshake Protocol
2016-08-31 19:20:44 +01:00
Derick Rethans
24b65ca159
PHPC-619: Implement Decimal128 type (again)
2016-08-31 17:13:17 +01:00
Derick Rethans
7f761be64f
Upgrade libbson and libmongoc to latest master (1.5.0-dev)
2016-08-31 12:28:02 +01:00
Jeremy Mikola
f7e2b09165
PHPC-605: Rely on libmongoc for socket IO and TLS
2016-08-30 14:04:56 -04:00
Jeremy Mikola
a6e7202498
PHPC-761: Remove BSON_NAMESPACE constant
2016-08-05 14:06:58 -04:00
ian boros
e545a5d52b
PHPC-755: Remove include of private mongoc-trace.h
2016-07-29 18:13:58 -04:00
Jeremy Mikola
ff79f64177
PHPC-758: Disable Decimal128 for bundled libbson and libmongoc 1.4.0
2016-07-29 18:11:41 -04:00
Jeremy Mikola
5c65399eca
Define ZSTR_VAL() for PHP 5 and remove phongo_str() macro
2016-07-14 11:27:18 -04:00
Jeremy Mikola
b3298a0efe
PHPC-739: Rename "javascript" to "code" in Javascript BSON class
...
This changes behavior of var_dump(), var_export(), and serialization.
Additionally, this renames the internal struct fields to be consistent with the publicized property names.
2016-07-13 10:32:45 -04:00
Jeremy Mikola
10e1879357
PHPC-460: UTCDateTime serialization and var_export
2016-07-12 16:30:43 -04:00
Jeremy Mikola
0a32ce98fb
PHPC-460: Timestamp serialization and var_export
2016-07-12 16:30:43 -04:00
Jeremy Mikola
4be966906a
PHPC-460: Decimal128 serialization and var_export
2016-07-12 16:30:42 -04:00
Jeremy Mikola
9b290494a2
PHPC-460: ObjectID serialization and var_export
2016-07-12 16:30:42 -04:00
Jeremy Mikola
f59e0f83dc
Merge branch 'v1.1'
2016-07-05 14:21:00 -04:00
Jeremy Mikola
99e499ab55
Trace returns from phongo_stream_initiator()
2016-07-05 13:51:31 -04:00
Jeremy Mikola
b67907e7f6
PHPC-720: Do not persist SSL streams to avoid SSL reinitialization errors
2016-07-05 13:51:30 -04:00
Jeremy Mikola
658fd8f51c
Merge branch 'v1.1'
2016-06-27 12:08:28 -04:00
Jeremy Mikola
0d0b14b9cd
Move php_phongo_new_datetime_from_utcdatetime() into UTCDateTime.c
...
This function was only used by UTCDateTime::toDateTime(), so it does not need to be in php_phongo.c. Additionally, this commit removes the platform-specific spprintf patterns in favor of the portable PRId64 pattern.
2016-06-27 11:53:41 -04:00
Jeremy Mikola
ceb506d636
Merge branch 'v1.1'
2016-06-27 11:04:44 -04:00
Yuriy
08902baa09
PHPC-631: Fix timelib_time.f assignment in UTCDateTime::toDateTime()
2016-06-21 16:37:05 -04:00
Jeremy Mikola
5ce569719c
PHPC-619: Implement Decimal BSON type
2016-06-21 08:35:21 -04:00
Jeremy Mikola
a327a22cb8
Merge branch 'v1.1'
2016-06-02 11:20:03 -04:00
Jeremy Mikola
857ab5199b
Use php_stream_context_from_zval() to get default stream context
...
This initializes the default context if it is not already set.
2016-06-01 22:56:21 -04:00
Jeremy Mikola
3b06e81f9a
PHPC-572: Keep stream context options alive for Manager's lifetime
2016-06-01 22:54:08 -04:00
Jeremy Mikola
2c4ed2a343
Use separate vars when fetching debug and context from driverOptions
2016-06-01 19:09:10 -04:00
Jeremy Mikola
1675a45105
Remove macros for PHP 5.3 compatibility
...
These macros are obsolete, as PHP 5.3 support was removed before the 1.0.0 release.
2016-06-01 19:00:47 -04:00
Jeremy Mikola
05fcc2ea4f
PHPC-671: Avoid mongoc_client_t use-after-free by Cursor and Server
2016-05-31 15:10:53 -04:00
Jeremy Mikola
a9d39dba9a
Merge branch 'v1.1'
2016-05-10 16:27:16 -04:00
Jeremy Mikola
c6d43a5015
PHPC-698: Check HAVE_OPENSSL_EXT before calling php-ssl.c functions
2016-05-10 15:19:58 -04:00
Jeremy Mikola
136077ddbb
PHPC-699: Rename "php_mongo" functions to not conflict with legacy driver
...
php_phongo_verify_hostname() can also be static, since it is not used outside of php_phongo.c
2016-05-10 15:16:09 -04:00
Jeremy Mikola
07e5475392
PHPC-665: Remove private libmongoc and libbson header includes
2016-05-06 11:51:54 -04:00
Jeremy Mikola
78839bde83
PHPC-688: Change Cursor debug handler to use libmongoc public API
...
This significantly alters the structure of the Cursor's debug output, since we not longer have access to private fields within mongoc_cursor_t.
2016-05-06 11:48:31 -04:00
Jeremy Mikola
e2209d50b8
PHPC-689: Use mongoc_cursor_set_hint() for query/command execution
...
Test changes were necessary because mongoc_cursor_set_hint() forces the slaveOk flag (CDRIVER-903).
2016-04-29 14:32:09 -04:00
Jeremy Mikola
3ad624eed0
PHPC-682: Do not use mongoc_bulk_operation_t private API
...
This adds php_phongo_bulkwrite_t fields to track extra information that we report in the BulkWrite debug handler.
2016-04-27 13:01:47 -04:00