Commit Graph

21 Commits

Author SHA1 Message Date
Jeremy Mikola 24ed8326b9 PHPC-529: Prefix BSON functions to avoid symbol conflicts 2016-01-06 13:57:42 -05:00
Jeremy Mikola 321c577f98 PHPC-285: Fix syntax for empty struct initializer
While "{ 0 }" should be sufficient, gcc's missing-braces warning requires that an extra pair of braces be used.

See: http://stackoverflow.com/q/11551986 and http://stackoverflow.com/a/20405554
2015-12-21 19:57:27 -05:00
Hannes Magnusson 6f6900fee9 PHPC-405: zval drop a level; zval*->zval, zval**->zval* 2015-12-16 10:22:58 +00:00
Hannes Magnusson 342c62747c PHPC-373: Remove MAKE_STD_ZVAL() usage
This simplifies calling bson_to_zval() quite a bit.

bson_to_zval() now takes empty zval*
bson_to_zval_ex() now takes php_phongo_bson_state (with empty zval*)

bson_to_zval() will always alloc and init state.zchild
2015-12-16 10:15:28 +00:00
Jeremy Mikola 194bbbd164 PHPC-311: Rename from/toArray() functions to from/toPHP() 2015-07-14 19:52:24 -04:00
Jeremy Mikola 965f8c3db4 PHPC-315: Support "root" type mapping for top-level documents 2015-07-14 19:52:24 -04:00
Hannes Magnusson 61c4432921 PHPC-309: Move the BSON namespace under MongoDB\ namespace
Having seperate MongoDB\Driver\ and BSON\ namespace was overruled :(

However, when you install pecl/bson seperately, it can be in the BSON
namespace, as it is a standalone package just wrapping libbson.

Since pecl/bson will be maintained in the same source as phongo, and I'd
like to share the testcases etc, we introduce a compile flag to detect
if we are compiling phongo or just bson, and set the namespace
appropriately
2015-06-30 09:54:21 -07:00
Hannes Magnusson fa1a263cc4 PHPC-260: Allow/use "object" in setTypeMap() as alias/preferred for "stdclass" 2015-04-23 16:13:35 -07:00
Hannes Magnusson 8d5e5d87c9 Bump copyright -- happy 2015 2015-04-23 10:16:20 -07:00
Hannes Magnusson c162c29215 PHPC-248: Allow ->setTypeMap() to set 'array' and 'stdclass' 2015-04-16 13:21:58 -07:00
Hannes Magnusson 3c57497760 PHPC-245: Allow embedding objects in updates 2015-04-15 13:54:07 -07:00
Hannes Magnusson e147fd3f7f PHPC-245: executeUpdate() converts objects to arrays
Multiple things here -- we shouldn't be injecting __pclass every time
we serialize an object -- only when we are preparing it to be inserted.
Otherwise, for example when executing an update, it will be injected
into the update document too -- which b0rks the update statement.

We also need to bail out when we don't get an array from the serialize
callback -- and rather then pretend the return array from the callback
is the data we got passed in in the get-go, keep the original zval
intact so we don't accidentally convert it to array
2015-04-15 11:27:19 -07:00
Hannes Magnusson e82b1d0639 PHPC-96: Add QueryResult->setTypemap() to overwrite array/object mapping 2014-12-31 21:31:56 -08:00
Hannes Magnusson 0d5b449616 PHPC-96: Retrieve arrays as custom objects 2014-12-30 14:36:17 -08: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 84a215df30 Make BSON types implement BSON\Type interface 2014-07-30 01:49:09 +00:00
Hannes Magnusson e619946d8c Returned generate _id when adding objects to batches 2014-07-19 02:58:53 +00:00
Hannes Magnusson 18dac2fee7 Add the ability to automatically generate _id 2014-07-18 23:43:30 +00:00
Jeremy Mikola 080053c7f7 Fix warning for bson_uint32_to_string() string pointer arg 2014-07-17 14:49:18 -04:00
Hannes Magnusson ac80d67b9d Added logging to files and command executing 2014-06-26 13:16:03 -07:00
Hannes Magnusson a36149a218 Initial BSON implementation 2014-06-20 14:55:03 -07:00