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
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
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
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
cdaa3b074d
Implement BSON\ObjectID properly
2014-08-06 21:59:24 +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
Hannes Magnusson
92ac59f4db
Simplify logging domain
2014-07-30 20:25:53 +00:00
Hannes Magnusson
867f0ed6e4
Sprinkly tad bit more logging and fix coupleof protos
2014-07-30 01:50:53 +00:00
Hannes Magnusson
03ea6499a5
Add json_to_bson() function
2014-07-30 01:50:29 +00:00
Hannes Magnusson
c7ac4714b2
Try properly to read as much data as requested
2014-07-30 01:50:04 +00:00
Hannes Magnusson
ff87de2d0f
Copy the oid
2014-07-30 01:49:38 +00:00
Hannes Magnusson
84a215df30
Make BSON types implement BSON\Type interface
2014-07-30 01:49:09 +00:00