Commit Graph

107 Commits

Author SHA1 Message Date
Hannes Magnusson
67040bde2b Integer IDs can also be int32 2014-12-02 17:21:57 -08:00
Hannes Magnusson
c7d3666d03 Differenciate the connection type by the SSL option 2014-12-02 16:13:16 -08:00
Hannes Magnusson
1b4e5ac11e Bail out when we cannot connect to the server! 2014-12-02 16:12:58 -08:00
Hannes Magnusson
4635cf875f PHP-1195: Error out on 32bit platforms if we cannot represent the int 2014-12-02 16:12:05 -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
da3754432f PHP-1175: Add Support for SSL=true and SSL=prefer 2014-12-02 14:29:41 -08:00
Hannes Magnusson
6283fe2a96 Improve API consistency between WriteConcern and ReadPreference
Also fixes a segfault when no WriteConcern is provided
2014-12-01 13:55:49 -08:00
Hannes Magnusson
a0f2e15126 PHP-1296: Implement WriteConcerns 2014-11-26 14:04:30 -08:00
Hannes Magnusson
bccdd2771f PHP-1294: Emtpy Query Result should still return QueryResult 2014-11-26 13:04:28 -08:00
Hannes Magnusson
89cd4faaf5 PHP-1293: Writing all debug info is not a good default 2014-11-26 12:25:19 -08:00
Hannes Magnusson
05e30cfcac Add missing arginfo for the BSON encoding functions 2014-11-26 12:23:51 -08:00
Hannes Magnusson
afb531055e Compiler warnings 2014-11-25 16:05:39 -08:00
Hannes Magnusson
3a7285ea73 Expose version constants and stability 2014-11-25 15:12:41 -08:00
Hannes Magnusson
35b19c45d5 Fix ZTS - and all the segfaults
We were reading it like good puppies.. But never assigning it! :D
2014-11-24 10:16:12 -08:00
Hannes Magnusson
9561a7426a Attempt to fix stream closing in zts 2014-11-21 21:05:10 -08:00
Hannes Magnusson
b682206c80 Fix zts builds 2014-11-21 20:39:24 -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
Hannes Magnusson
75ee2248e4 Fixed couple of constify, and renamed a functino to be consistent with'em all 2014-11-21 10:52:10 -08:00
Hannes Magnusson
f5b5d6ddef PHP-1187: Implement BSON binary type 2014-11-21 09:51:27 -08:00
Hannes Magnusson
55e6be8f55 Fix some compiler warnings: (de-)constify 2014-11-21 09:46:41 -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
56435950b3 Fixed zts macros 2014-11-20 17:08:55 -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
Hannes Magnusson
bf13da3857 Fixed PHP-1232: Implement the TODO 2014-11-19 10:27:48 -08:00
Hannes Magnusson
ffc489636f Tell PHP this is indeed an exposed stream that it doesn't have to worry about 2014-11-19 10:07:01 -08:00
Hannes Magnusson
ef5a23cc32 Fix memory leak when splitting a ns 2014-11-19 10:07:01 -08:00
Hannes Magnusson
7445744c55 Make sure we have something to free 2014-11-19 10:07:01 -08:00
Christian Kvalheim
ccc4bf8923 Fixed build for OSX and llvm 2014-10-20 11:26:25 +02:00
Jeremy Mikola
efb777255f PHP-1230: Clean up WriteResult property storage on WriteException 2014-10-02 14:43:12 -04:00
Jeremy Mikola
ad0f50d27d Use correct return types for WriteResult-related init functions
We never check whether WriteResult init succeeds, which is fine as it sets whatever it can on the corresponding object. For the error inits, we actually do care if they succeed or fail so that we can free up the zvals; however, the return types should be booleans.
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
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
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
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