Commit Graph

3944 Commits

Author SHA1 Message Date
Jeremy Mikola
5d6052e884 PHP-1142: Dump WriteResult object in write tests 2014-09-29 11:37:47 -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
22b3622ab8 PHP-1142: Memory cleanup and getters for WriteResult error zvals 2014-09-25 15:57:49 -04:00
Jeremy Mikola
7a1c18dbc9 Fix tab indentation for generated C code 2014-09-25 15:57:49 -04:00
Jeremy Mikola
33e2451cda Throw WriteException on failed write ops
If available, the WriteResult should be set on the exception
2014-09-25 15:57:49 -04:00
Jeremy Mikola
9aaa2de17b PHP-1230: Implement WriteException class 2014-09-25 15:57:48 -04:00
Jeremy Mikola
b4b858abe9 Return exceptions after throwing in case we need to modify them 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
9e5b4167fe PHP-1171: Move WriteConcernError init function to php_phongo.c
The functions in each class file are not exported (since we don't have headers), and this ultimately needs to be called by the WriteResult initialization function. Therefore, it's best placed in php_phongo.c for now, as we did with WriteError's function.
2014-09-24 15:50:37 -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
6d5c7cd0d4 Fix typo in constant name 2014-09-24 14:10:51 -04:00
Jeremy Mikola
d0d57d7313 Ensure libmongoc structs get freed in WriteBatch and WriteConcern 2014-09-23 13:17:22 -04:00
Jeremy Mikola
d965e53e11 Merge pull request #14 from bjori/php-1171-writeconcernerror
PHP-1171: Implement WriteConcernError class
2014-09-18 15:53:09 -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
bc19662359 Merge pull request #13 from bjori/php-1068
PHP-1068: Test that CommandResult is iterable
2014-09-05 17:23:09 -04:00
Jeremy Mikola
d702c53561 PHP-1068: Test that CommandResult is iterable
Use ping instead of isMaster since the result document is more predictable.
2014-09-05 17:02:08 -04:00
Jeremy Mikola
8e3f9fbfc6 Merge pull request #12 2014-08-25 13:58:13 -04:00
Jeremy Mikola
291b41d031 Always wrap query filter with $query modifier 2014-08-25 13:55:59 -04:00
Jeremy Mikola
3d047316f5 Use array helpers instead of hash iteration in Query option parsing
Fetching a nonexistent key returns zero, which is a safe assignment for the numeric query options. For other options, we raise an error if the expected type is invalid (this should likely be changed to an exception).
2014-08-25 13:55:59 -04:00
Jeremy Mikola
17d4dc7c19 Error if phongo_query_init() filter isn't array or object
This is just a sanity check, since zpp in the Query constructor should ensure we have the appropriate type.
2014-08-25 13:55:59 -04:00
Jeremy Mikola
7f5d0ef5b5 Use ZEND_STRS() when passing string/size arguments
ZEND_STRS cannot be used with the zend_hash_update macro, since the preprocessor complains about a missing argument before expanding ZEND_STRS. Creating a variadic macro to wrap zend_hash_update would work, but instead we'll just manually expand ZEND_STRS.
2014-08-25 13:55:59 -04:00
Jeremy Mikola
4eae11b928 Fix setting of zvals with zend_hash_update() when constructing query
New tests cases for fixed hash update code paths on $orderby and $query keys.
2014-08-25 13:55:59 -04:00
Jeremy Mikola
efcbf0ea6d Update tests for revised Query constructor API 2014-08-25 13:55:59 -04:00
Jeremy Mikola
30a9a80492 Change Query constructor args based on CRUD API spec
Query document is the only required field. All other fields are optional. To avoid complicating the constructor, we'll handle the option merging in the init function.
2014-08-25 13:55:59 -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
c80df50341 bump submodules 2014-08-22 17:52:43 +00:00
Hannes Magnusson
604765e158 WS 2014-08-20 00:25:26 +00:00
Hannes Magnusson
8acdc925ac Fix segfault when no namespace is passed 2014-08-20 00:25:15 +00:00
Hannes Magnusson
901ecf373a BSON: Fix serializing arrays inside of objects 2014-08-20 00:22:37 +00:00
Hannes Magnusson
a3ce178fae Move BSON encode/decode stuff into BSON namespace
BSON\toArray()
BSON\toJSON()
BSON\fromArray()
BSON\fromJSON()
2014-08-13 21:31:50 +00:00
Hannes Magnusson
c9caf9e3ed Enable a waterfall of compiler instructions for libbson and mongoc 2014-08-13 20:31:59 +00:00
Hannes Magnusson
9c9e0483be Supress the initialization output 2014-08-13 13:18:24 -07:00
Hannes Magnusson
9d84ccc0c2 These dirs are required for all normal 'make' targets 2014-08-12 18:06:48 +00:00
Hannes Magnusson
018e54acb0 Overwrite the path to libbson that should be linked against 2014-08-12 08:55:49 -07:00
Hannes Magnusson
7b66a77182 debugging travis 2014-08-12 08:06:30 +00:00
Hannes Magnusson
47ec27ee37 Build against bundled.. just not mongoc bundled 2014-08-12 07:55:48 +00:00
Hannes Magnusson
298c456a37 Remove empty dir since there is nothing to make there 2014-08-12 07:42:49 +00:00
Hannes Magnusson
d33b482dda Hack around mongo-c-driver not allowing us specify libbson location 2014-08-12 07:34:52 +00:00
Hannes Magnusson
5325b7c773 Link against libbson and make it available to mongo-c-driver 2014-08-12 06:37:42 +00:00
Hannes Magnusson
917fa04c71 Missed a file 2014-08-12 06:15:41 +00:00
Hannes Magnusson
4cc69b3430 We submodule these now and automatically build it 2014-08-12 06:09:02 +00:00
Hannes Magnusson
9c87738021 submodule mongo-c-driver and libbson and build it into phongo 2014-08-12 06:06:48 +00:00
Hannes Magnusson
20d177562c Fix zts 2014-08-08 23:38:31 +00:00
Hannes Magnusson
78fd7b78ee Reduce mongoc stuff we compile and install 2014-08-08 23:33:08 +00:00
Hannes Magnusson
f6588efe63 Link against libmongoc-priv so we can go into the gory details 2014-08-08 23:04:05 +00:00
Hannes Magnusson
cdaa3b074d Implement BSON\ObjectID properly 2014-08-06 21:59:24 +00:00
Hannes Magnusson
98383aa178 Fix installing lcov 2014-08-04 21:14:35 +00:00
Hannes Magnusson
ad331ffb65 Only skip it on travis 2014-07-31 22:15:29 +00:00
Hannes Magnusson
e0e17c4a04 CID-24876: Actually check for the return value and raise a warning now 2014-07-30 20:26:06 +00:00