57 Commits

Author SHA1 Message Date
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
Hannes Magnusson
5a4778f928 PHPC-163: Throw BulkWriteException on BulkWrite failure
For execute[Insert|Update|Delete]() we unroll the BulkWrite exception
and throw the inner errors.

Note: WriteConcern failure now throws WriteConcernException!
2015-03-03 10:21:37 -08:00
Hannes Magnusson
457b6452fa PHPC-165: Rename WriteBatch to BulkWrite 2015-02-20 15:05:29 -08:00
Hannes Magnusson
4cf9536f96 PHPC-164: Throw MongoDB\Driver\ConnectionTimeoutException 2015-02-19 15:02:49 -08:00
Hannes Magnusson
dad5d51b12 PHPC-107: Throw ExecutionTimeoutException for maxTimeMs 2015-02-19 13:15:04 -08:00
Hannes Magnusson
481600d990 PHPC-157: Consolidate CommandResult and QueryResult classes 2015-02-18 11:09:36 -08:00
Hannes Magnusson
d8506faa31 PHPC-154: WriteError can have info field 2015-02-18 09:52:47 -08:00
Hannes Magnusson
30aa95b66c PHPC-152: Throw MongoDB\Driver\InvalidArgumentException on argument errors 2015-02-06 16:31:06 -08:00
Hannes Magnusson
8e3bd3d8c7 PHPC-116: Cursor methods should call their respective iterator function handlers 2015-01-06 16:45:55 -08:00
Hannes Magnusson
865297f79a Smiplify cursor/results to prep for PHPC-116 2015-01-06 16:45:55 -08:00
Hannes Magnusson
148e726e26 PHPC-42: BSON Serialization for classes
This is a basic ODM.
When a class implements the BSON\Persistable interface gets bson
encoded we will embed a __ binary(type=0x80) value into the document.
Upon bson decoding a document, if we find that binary type convert that
document/array into the php class
2015-01-02 11:08:40 -08:00
Hannes Magnusson
0744895e16 PHPC-96 & PHPC-119 call the new bsonUnserialize method and optimize things a little 2014-12-31 18:55:41 -08:00
Hannes Magnusson
2691047570 PHPC-120: BSON\toArray should support classmap to unserialize as 2014-12-31 18:55:41 -08:00
Hannes Magnusson
3fa8cc8159 PHPC-119 && PHPC-49: Create PHP interfaces for BSON (un-)serialization 2014-12-31 18:55:08 -08:00
Hannes Magnusson
0d5b449616 PHPC-96: Retrieve arrays as custom objects 2014-12-30 14:36:17 -08:00
Hannes Magnusson
36113dc30a PHPC-115: Remove now-useless GeneratedId
The point of it was to bactract to which batch index it belonged to.
We now return correctly indexed array for this, a long with the actual id
for the upsert
2014-12-23 11:18:29 -08:00
Hannes Magnusson
0d303e63bf PHPC-113: WriteConcernError is just one error, not multiple
This allows to actually retrieve - and know about - the error
2014-12-23 11:01:32 -08:00
Hannes Magnusson
6abfa11ea1 PHPC-104: Throw MongoDB\AuthenticationException on auth failure 2014-12-19 10:01:11 -08:00
Hannes Magnusson
95774b10d2 PHPC-101: throw MongoDB\DuplicateKeyException 2014-12-18 17:39:23 -08:00
Hannes Magnusson
ffa8006bce PHON-99: Add & Implement SSLConnectionException 2014-12-17 11:52:39 -08:00
Hannes Magnusson
2aa41c0eaa PHON-98: Implement and properly throw MongoDB\ConnectionException 2014-12-17 11:47:41 -08:00
Hannes Magnusson
1606f518d4 PHON-97: Add MongoDB\RuntimeException
This exception extends SPL RuntimeException - and implements
MongoDB\Exception

This makes it easy to catch "all MongoDB exceptions" and/or
RuntimeExceptions
2014-12-17 11:22:40 -08:00
Hannes Magnusson
f1031fe246 PHON-96: Create MongoDB\Exception interface 2014-12-17 11:20:58 -08:00
Hannes Magnusson
b2f29d887d PHP-1338: There is actually no DBRef BSON type, its a convention 2014-12-12 15:51:56 -08:00
Hannes Magnusson
518e2b4664 I have no idea what made me make BSON\Pool 2014-12-09 16:39:43 -08:00
Hannes Magnusson
ba8378e1fd PHP-1319: Implement command cursors 2014-12-08 10:17:17 -08:00
Hannes Magnusson
fa414d1018 PHP-1195: Remove Int32 and Int64 classess
Keeping these would force everyone to use them, which is not cool when
the majority of users shouldn't have to
2014-12-02 14:54:16 -08:00
Hannes Magnusson
ef5afd98d6 Remove misterious BSON\Log class 2014-12-02 14:53:37 -08:00
Hannes Magnusson
27ae67c5e2 Fixed various memory leaks and compiler warnings 2014-11-21 17:30:58 -08:00
Hannes Magnusson
23bb9a63ff PHP-1189: Implement BSON regex type 2014-11-21 10:53:10 -08:00
Jeremy Mikola
76d49f792b PHP-1189: BSON Regex type 2014-11-21 10:05:29 -08:00
Hannes Magnusson
f5b5d6ddef PHP-1187: Implement BSON binary type 2014-11-21 09:51:27 -08:00
Hannes Magnusson
dfbef380a5 PHP-1188: Implement BSON code and code with scope types
NOTE: This type is not supported by Extended JSON :(
2014-11-20 17:33:10 -08:00
Hannes Magnusson
4a8b86c1a2 PHP-1191: Implement BSON timestamp type 2014-11-20 15:47:43 -08:00
Hannes Magnusson
c439fbcc67 PHP-1190: Implement BSON\UTCDateTime 2014-11-19 17:07:13 -08:00
Hannes Magnusson
7636ed4e76 PHP-1185: Add more Cursor related methods 2014-11-19 17:05:10 -08:00
Hannes Magnusson
5dc733469b PHP-1183: Implement default Iterator class for QueryResult & CommandResult 2014-11-19 12:55:38 -08:00
Jeremy Mikola
efb777255f PHP-1230: Clean up WriteResult property storage on WriteException 2014-10-02 14:43:12 -04:00
Jeremy Mikola
e6fc9b0624 PHP-1142: Support upserted ids in WriteResult
Renamed getGeneratedIdsForUpsert() to getUpsertedIds().
2014-09-29 11:37:46 -04:00
Jeremy Mikola
7358ac7f6c PHP-1142: Implement WriteResult getter for meta information
This getter is intended to return situational fields (e.g. lastOp, electionId), which are not currently supported by libmongoc (see: CDRIVER-428).
2014-09-25 16:02:45 -04:00
Jeremy Mikola
9aaa2de17b PHP-1230: Implement WriteException class 2014-09-25 15:57:48 -04:00
Jeremy Mikola
12cc8616dc PHP-1142: Init WriteError and WriteConcernError arrays for WriteResult
When initializing a WriteResult, we should initialize the corresponding WriteError and WriteConcernError classes, too. This moves all of the initialization code into php_phongoc, as was done with the error classes.

Additionally, phongo_execute_write() has been changed to not construct a bson_t reply unnecessarily (i.e. return value will not be used).
2014-09-25 15:57:48 -04:00
Jeremy Mikola
b1b5568edd PHP-1172: Implement WriteError class
Removed getter for bulk operation corresponding to the index, since that would require reconstructing zvals from the libmongoc structs.
2014-09-24 15:48:32 -04:00
Jeremy Mikola
783c14d1c6 PHP-1171: Implement WriteConcernError class
Removed constructor and implemented populate method, which should operate on BSON documents within WriteResult's writeConcernError(s) field.
2014-09-17 15:55:18 -04:00
Jeremy Mikola
5d7485eb45 Rename query document field in query struct
Selector and query are both BSON, so a "bson" field is a bit ambiguous.
2014-08-25 13:55:59 -04:00
Hannes Magnusson
cdaa3b074d Implement BSON\ObjectID properly 2014-08-06 21:59:24 +00:00
Hannes Magnusson
84a215df30 Make BSON types implement BSON\Type interface 2014-07-30 01:49:09 +00:00
Hannes Magnusson
f23cef90ca Implement WriteConcern 2014-07-21 22:20:05 +00:00
Hannes Magnusson
0c644bb2c5 Add ObjectID support 2014-07-19 00:52:57 +00:00