Skip to content
This repository was archived by the owner on Dec 23, 2021. It is now read-only.

Commit 669df94

Browse files
committed
Merged pull request #61
2 parents 9bc3820 + a716733 commit 669df94

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

bson.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
#include "bson.h"
2323
#include "utils.h"
24+
#include "mongodb.h"
2425
#include <iostream>
2526

2627
#include "src/MongoDB/BSON/Binary.h"
@@ -111,14 +112,20 @@ void VariantToBsonConverter::convertElement(bson_t *bson, const char *key, Varia
111112
convertString(bson, key, v.toString());
112113
break;
113114
case KindOfArray:
115+
#if HIPPO_HHVM_VERSION >= 31100
116+
case KindOfPersistentArray:
117+
#endif
114118
case KindOfObject:
115119
convertDocument(bson, key, v);
116120
break;
121+
case KindOfRef:
122+
convertElement(bson, key, *v.getRefData());
123+
break;
117124
case KindOfResource:
118125
throw MongoDriver::Utils::throwUnexpectedValueException("Got unsupported type 'resource'");
119126
return;
120-
default:
121-
break;
127+
case KindOfClass:
128+
not_reached();
122129
}
123130
}
124131

@@ -514,7 +521,6 @@ bool hippo_bson_visit_array(const bson_iter_t *iter __attribute__((unused)), con
514521
BsonToVariantConverter converter(bson_get_data(v_array), v_array->len, state->options);
515522
converter.convert(&array_v);
516523

517-
std::cerr << key << "\n";
518524
state->zchild.add(String::FromCStr(key), array_v);
519525

520526
return false;

ext_mongodb.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ public function __debugInfo()
7979
}
8080
}
8181

82+
<<__NativeData("MongoDBDriverWriteResult")>>
8283
final class WriteResult {
8384
private $nUpserted = 0;
8485
private $nMatched = 0;
@@ -701,6 +702,7 @@ final class MinKey implements Type, \Serializable
701702
use DenySerialization;
702703
}
703704

705+
<<__NativeData("MongoDBBsonObjectID")>>
704706
final class ObjectID implements Type, \Serializable
705707
{
706708
use DenySerialization;

0 commit comments

Comments
 (0)