Commit Graph

105 Commits

Author SHA1 Message Date
Jeremy Mikola
d1d9d4a2bd PHPC-980: MongoDB\Driver\Session and "session" option
This introduces a Session class, which wraps libmongoc's client session object. Additionally, we support a "session" option on Manager and Server execute methods to allow operations to be associated with an explicit session (mostly relevant for causal consistency).
2017-12-15 16:25:56 -05:00
Derick Rethans
d3953f62a2 PHPC-1027: Introduce classes for deprecated BSON types (DBPointer) 2017-12-14 10:49:18 +00:00
Derick Rethans
a9f6e3bb09 PHPC-1027: Introduce classes for deprecated BSON types (Symbol) 2017-12-14 10:49:18 +00:00
Derick Rethans
c780a27926 PHPC-1027: Introduce classes for deprecated BSON types (Undefined) 2017-12-13 16:09:49 +00:00
Jeremy Mikola
a5fe81bd06 PHPC-640: Revert TypeWrapper interface 2017-08-28 17:54:55 -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
277df7ebee PHPC-640: TypeWrapper interface 2017-04-26 11:23:26 -04: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
12e2ee6294 PHPC-911: Use prefixed symbols for shared construct/wakeup FEs 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
Jeremy Mikola
931e9d9b11 Remove obsolete php_phongo_result_ce extern 2017-02-10 15:56:12 -05:00
Jeremy Mikola
064add8f8e PHPC-907: Remove PHONGO_API macro for exported symbols 2017-02-10 15:56:12 -05:00
Jeremy Mikola
3ff292cbb8 PHPC-879: Remove dependency on php_date_get_immutable_ce() 2017-01-11 11:14:20 -05:00
Jeremy Mikola
997fe40f9c PHPC-878: Remove dependency on php_json_serializable_ce symbol
Since JsonSerializable is required, this also adds a helpful startup error message if json.so is not already loaded.
2017-01-11 11:14:20 -05:00
Jeremy Mikola
2efc183b38 PHPC-890: Add license header copypasta 2017-01-06 15:41:58 -05:00
Derick Rethans
24b65ca159 PHPC-619: Implement Decimal128 type (again) 2016-08-31 17:13:17 +01: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
4e26b503bd Declare __wakeup as lowercase for consistency 2016-07-15 11:11:48 -04:00
Jeremy Mikola
85309157b7 Consolidate PHP 5 and 7 struct definitions into one file 2016-07-11 12:25:16 -04:00
Jeremy Mikola
52266fbd51 Remove unused int32, int64, and log class entries 2016-07-11 12:25:16 -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
1978caad20 Revise object macros for use within expressions 2016-05-28 19:32:49 -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
Derick Rethans
c0d4f60a1d Fixed issues with PHP 7 and the new ReadConcern 2015-12-18 16:15:40 +00:00
Hannes Magnusson
00c66b9670 PHPC-380: PHP7 create/free object changes 2015-12-16 10:20:04 +00:00
Patrick Boyd
9135dbf723 PHPC-380: create/free object handlers for PHP7 2015-12-16 10:19:30 +00:00
Hannes Magnusson
20a3044dd1 PHPC-369: Split PHP5 and PHP7 style custom object struct declrations 2015-12-16 10:13:02 +00:00
Jeremy Mikola
12e6907e41 PHPC-448: Support readConcern option on Query 2015-12-11 15:22:55 -05:00
Jeremy Mikola
92348caffc PHPC-448: Implement ReadConcern class 2015-12-11 14:44:59 -05:00
Jeremy Mikola
70c092f379 PHPC-465: Remove WriteConcernException and WriteErrorException
These exceptions were only used by the single write methods.
2015-10-21 23:42:40 -04:00
Jeremy Mikola
011c0c264c PHPC-440: WriteErrorException extends abstract WriteException
This makes WriteException a common base class of WriteConcernException and WriteErrorException. BulkWriteException, which may contain multiple write and/or write concern errors, will continue to inherit WriteException.
2015-10-21 19:32:42 -04:00
Jeremy Mikola
15a9f709d2 PHPC-462: Remove unused DuplicateKeyException
This class was not being used, since executeBulkWrite() uses BulkWriteException and the single write methods use WriteException and WriteConcernException exclusively.
2015-10-20 12:23:38 -04:00
Derick Rethans
89caf72c6a Rename BSON\Binary's subType field and getSubType() method to type and getType() 2015-08-04 10:42:45 +01:00
Hannes Magnusson
803f4317f1 PHPC-321: UTCDatetime -> UTCDateTime 2015-06-30 10:29:57 -07:00
Hannes Magnusson
5688dd17cf PHPC-284: Fix LogicException declaration 2015-05-13 12:50:07 -07:00
Jeremy Mikola
4e7df722dd PHPC-282: Cursor should not yield multiple iterators
Successive get_iterator handler invocations should throw a LogicException. This avoids situations that might allow the user to iterate over the same cursor multiple times.
2015-05-04 16:15:17 -04:00
Jeremy Mikola
5bf6e2ccfd PHPC-284: Create MongoDB\Driver\Exception\LogicException class 2015-05-04 16:15:17 -04:00
Hannes Magnusson
ebc15aefea PHPC-266: Add MongoDB\Driver\UnexpectedValueException 2015-04-23 16:13:35 -07:00
Hannes Magnusson
8d5e5d87c9 Bump copyright -- happy 2015 2015-04-23 10:16:20 -07:00
Jeremy Mikola
c7b7891697 PHPC-240: Rely on libmongoc for command cursor iteration
libmongoc already provides a mechanism to upgrade a cursor with a single command result document into a command cursor, which will seamlessly iterate through the first batch and documents returned by successive getmore ops.

This allows us to remove our own "first batch" handling and simplify the move_forward and rewind iteration handlers.
2015-04-21 14:23:16 -04:00
Hannes Magnusson
c162c29215 PHPC-248: Allow ->setTypeMap() to set 'array' and 'stdclass' 2015-04-16 13:21:58 -07:00
Hannes Magnusson
cd2660bc1a PHPC-233: Mark the ctor as private for internally created value objects 2015-04-09 09:16:42 -07:00
Jeremy Mikola
c454d27d95 PHPC-215: Fix Cursor iteration through IteratorIterator
This removes the invalidate_current handler. Due to SPL's implementation, our handler was being invoked between rewinding and checking if the current position was valid. Given that our validity check depends on inspecting a pointer to the current element (like MySQLi's result iterator), we cannot use invalidate_current.

The current element must still be freed during iteration, so we will instead call a php_phongo_cursor_free_current() function as needed. Additionally, we should track a reference to the Cursor object zval on the iterator itself, which will ensure it is not garbage-collected during iteration (demonstrated in the segfault backtrace in PHPC-215).

Lastly, this commit renames the Cursor object and iterator structs and related functions to be more consistent with implementions in PHP core.
2015-04-06 15:45:19 -04:00
Jeremy Mikola
66193e83bc PHPC-224: Consolidate Result and Cursor classes into one
This class is now simply Traversable (no longer IteratorAggregate) and adds isDead() and getId() methods from the original Cursor class.
2015-04-06 15:45:19 -04:00
Hannes Magnusson
69bc19724d PHPC-190: Provide __wakeUp() to disable unserialize() 2015-04-03 13:02:19 -07:00
Jeremy Mikola
1f9f7716d9 PHPC-214: Result does not need custom iterator classes
Wrapping a cursor can already be accomplished with IteratorIterator.
2015-03-31 15:29:19 -04:00
Hannes Magnusson
5f8d990b53 PHPC-24 PHPC-77 PHPC-69 Provide a functioning Server object 2015-03-20 11:33:46 -07:00
Jeremy Mikola
ae0219d69e PHPC-168: Implement WriteResult::isAcknowledged()
We copy the write concern struct rather than store an is_acknowledged boolean, which allows us to include the write concern in the debug output. Down the line, we may decide to implement a getWriteConcern() method to help users in handling/logging write concern errors.
2015-03-13 02:26:51 -04:00