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

HHVM-157: The Ghost Bug and HHVM-163: Add additional 3.11 data types support #61

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions bson.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

#include "bson.h"
#include "utils.h"
#include "mongodb.h"
#include <iostream>

#include "src/MongoDB/BSON/Binary.h"
Expand Down Expand Up @@ -107,14 +108,20 @@ void VariantToBsonConverter::convertElement(bson_t *bson, const char *key, Varia
convertString(bson, key, v.toString());
break;
case KindOfArray:
#if HIPPO_HHVM_VERSION >= 31100
case KindOfPersistentArray:
#endif
case KindOfObject:
convertDocument(bson, key, v);
break;
case KindOfRef:
convertElement(bson, key, *v.getRefData());
break;
case KindOfResource:
throw MongoDriver::Utils::throwUnexpectedValueException("Got unsupported type 'resource'");
return;
default:
break;
case KindOfClass:
not_reached();
}
}

Expand Down Expand Up @@ -510,7 +517,6 @@ bool hippo_bson_visit_array(const bson_iter_t *iter __attribute__((unused)), con
BsonToVariantConverter converter(bson_get_data(v_array), v_array->len, state->options);
converter.convert(&array_v);

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

return false;
Expand Down
2 changes: 2 additions & 0 deletions ext_mongodb.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ public function __debugInfo()
}
}

<<__NativeData("MongoDBDriverWriteResult")>>
final class WriteResult {
private $nUpserted = 0;
private $nMatched = 0;
Expand Down Expand Up @@ -701,6 +702,7 @@ final class MinKey implements Type, \Serializable
use DenySerialization;
}

<<__NativeData("MongoDBBsonObjectID")>>
final class ObjectID implements Type, \Serializable
{
use DenySerialization;
Expand Down