Commit Graph

185 Commits

Author SHA1 Message Date
Hannes Magnusson 3b78578ba3 Allow mongoc_init() to not use our mm
There is a shutdown race condition in the mongoc counters segment
allocation where zend mm will free the counters during RSHUTDOWN.
This happens as there is no "persistent alloc" callback from the bson
allocators that we can pemalloc() for.
Instead, we'll let mongoc_init use its own alloctors -- but we have to
remember to reset the alloc callbacks before mongoc_cleanup()
2015-03-25 13:22:37 -07:00
Hannes Magnusson c5a0711972 PHPC-200: Don't set stream initiator when creating client fails 2015-03-25 08:55:30 -07:00
Hannes Magnusson c21eb74f29 Simplify
It originally was used for more then just plain result, but now we
always have the cursor so no need to pass the server_id
2015-03-24 09:31:50 -07:00
Hannes Magnusson 809e99d7b8 PHPC-174: Rename module registration, constants and so on to mongodb 2015-03-23 16:37:38 -07:00
Hannes Magnusson 4daeefa3a5 Remove char * casting, the macro soup leads to incorrect sizeof 2015-03-23 12:46:55 -07:00
Hannes Magnusson 7ccd38c870 Fix zts 2015-03-20 16:49:34 -07:00
Hannes Magnusson b40a98e677 PHPC-183: Fix compiler warnings with -Wdeclaration-after-statement
This also increases the chances of successful Windows build :)
2015-03-20 15:37:24 -07:00
Hannes Magnusson 5f8d990b53 PHPC-24 PHPC-77 PHPC-69 Provide a functioning Server object 2015-03-20 11:33:46 -07:00
Hannes Magnusson d53c90ce94 PHPC-106: Connect asynchronouslyish 2015-03-19 14:20:44 -07:00
Hannes Magnusson b825395d18 PHPC-106: Implement the new poll callback 2015-03-19 14:20:44 -07:00
Hannes Magnusson 50fe097841 Store the original mongoc_uri_t not just the options bson 2015-03-19 14:20:44 -07:00
Hannes Magnusson 14533db5d8 Add a little tracing love 2015-03-18 11:50:35 -07:00
Hannes Magnusson 57ed2c92fb Properly block on socket writes
If a socket write returns EWOULDBLOCK PHP will poll() using the socket
read timeout.
This is only an issue when writing crazy amount of data to a
non-blocking socket in multiple iterations... which we do.
2015-03-18 11:40:04 -07:00
Hannes Magnusson ddc558e32a Fix null pointer exception 2015-03-18 11:39:14 -07:00
Hannes Magnusson b6b6e9636f Unhide this 2015-03-18 11:30:26 -07:00
Jeremy Mikola aa5903790a Return const struct pointers from zval getters 2015-03-17 16:17:24 -04:00
Jeremy Mikola b5f8c34dae PHPC-181: Discard const qualifiers for PHP API 2015-03-17 16:14:27 -04:00
Jeremy Mikola 00f2da72f8 PHPC-181: Use const for pointer args where applicable 2015-03-17 16:10:04 -04: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
Jeremy Mikola 9298ad8153 PHPC-170: Don't set write concern on bulk unnecessarily 2015-03-13 02:26:51 -04:00
Jeremy Mikola 70715516b5 PHPC-177: Include all fields in WriteConcern debug output
This mainly removes logic where no fields were included in the debug output if "w" was equal to MONGOC_WRITE_CONCERN_W_DEFAULT.

Although the "wmajority" boolean exists, we can still report the actual "w" value, which will be sent to the server.
2015-03-13 02:26:51 -04:00
Hannes Magnusson 88ae5da011 Fixed missing type specifier warning 2015-03-12 10:16:47 -07:00
Hannes Magnusson bfccc982d8 PHPC-171: SSL Doesn't work in PHP5.6 2015-03-11 09:53:55 -07:00
Hannes Magnusson 8d70199272 Add micro-optimization tip for the future 2015-03-03 15:35:29 -08: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 713dc5a78c PHPC-159: memleak on failed path resolving 2015-02-18 12:01:47 -08:00
Hannes Magnusson ced7c408f3 PHPC-158: Split queryFlags bitmask option into specific options 2015-02-18 11:46:10 -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 6ca5cdb034 PHPC-153: Rename cursorFlags to queryFlags in Query 2015-02-06 16:33:03 -08:00
Hannes Magnusson 30aa95b66c PHPC-152: Throw MongoDB\Driver\InvalidArgumentException on argument errors 2015-02-06 16:31:06 -08:00
Hannes Magnusson 5ce5b702ca Throw our RuntimeException, not SPL 2015-02-06 12:09:07 -08:00
Hannes Magnusson 7d42eba7ee This is a result iterator, not cursor 2015-02-02 13:20:36 -08:00
Hannes Magnusson 02d022df47 PHPC-149: Iterator holding on to dead results 2015-02-02 13:20:36 -08:00
Hannes Magnusson 61a47d4908 NULLify after destroy and clear 2015-01-30 16:14:41 -08:00
Hannes Magnusson 17e4f3e806 Make sure we have a document before dumping it 2015-01-29 10:16:55 -08:00
Hannes Magnusson 282e540354 Add SSL to the persistance hash 2015-01-29 10:16:39 -08:00
Hannes Magnusson 7626368622 PHPC-139: var_dump()ing WriteBatch 2015-01-27 13:23:42 -08:00
Hannes Magnusson 770c2b579f PHPC-136: var_dump() CommandResult and QueryResult 2015-01-09 16:00:08 -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 c1630c4414 PHPC-116: Implement invalidate_current handler to reduce code 2015-01-06 16:45:50 -08:00
Hannes Magnusson af80d64193 PHPC-42: Implement root level (full document) ODM style serialization 2015-01-05 14:32:11 -08:00
Hannes Magnusson 51ac675ad7 PHPC-125: pointer to out of scope variable :] 2015-01-05 12:58:39 -08:00
Hannes Magnusson c73c3fd574 PHPC-124: Buffer not null terminated 2015-01-05 12:32:57 -08:00
Hannes Magnusson 99d723e51c PHPC-126: Fixed unchecked return 2015-01-05 11:50:56 -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