mongofill / mongofill-hhvm

A mix of the original Mongofill extension + BSON implementation in C++
MIT License
32 stars 19 forks source link

It doesn't compile with hhvm 3.4.2-1 archlinux #21

Closed jrborbars closed 9 years ago

jrborbars commented 9 years ago

The following error occur when I tried to build (build.sh) mongofill in arch linux 3.17.6-1 x86_64, with the latest (4 Jan 15) version cloned from this repo.

... [ 66%] Building CXX object CMakeFiles/mongo.dir/src/encode.cpp.o /home/user/mongofill-hhvm/src/encode.cpp: In function ‘void HPHP::objectToBSON(const HPHP::Object&, const char_, bsont)’: /home/user/mongofill-hhvm/src/encode.cpp:86:36: error: ‘class HPHP::ObjectData’ has no member named ‘getClassName’ const String& className = value->getClassName(); ^ CMakeFiles/mongo.dir/build.make:77: recipe for target 'CMakeFiles/mongo.dir/src/encode.cpp.o' failed make[2]: * [CMakeFiles/mongo.dir/src/encode.cpp.o] Error 1 CMakeFiles/Makefile2:60: recipe for target 'CMakeFiles/mongo.dir/all' failed make[1]: * [CMakeFiles/mongo.dir/all] Error 2 Makefile:117: recipe for target 'all' failed make: *\ [all] Error 2

Maibe the solution is in the following lines, but my knowledge of this syntax is very bad. 8-(

//* Objects // static ObjectData instanceNewObject(const StaticString* className, Array params) { TypedValue ret; Class* cls = Unit::loadClass(className->get()); ObjectData* obj = ObjectData::newInstance(cls); obj->incRefCount();

g_context->invokeFunc( &ret, cls->getCtor(), params, obj );

return obj; }

Additional info: HipHop VM 3.4.2 (rel) Compiler: 1420330388_659108331 Repo schema: 659673661_1420330388 Extension API: 20140829

Maybe the SAME problem that occur in issue #19 . I'll try the workaround, but not a git master. How can I download this branch? Best regards,

Pomyk commented 9 years ago

You can checkout that revision: git checkout 5891ae1

jrborbars commented 9 years ago

Works like a charm! Thank you. The build.sh runs ok, and I copy the mongo.so to my HHVM extensions folder. I restart HHVM, but nothing happens. I run get_declared_classes() and get_loaded_extensions(), and nothing about mongo. Any ideas?

Pomyk commented 9 years ago

Are you loading the extension? In /etc/hhvm/php.ini something like:

hhvm.dynamic_extensions[mongo] = /path/to/extensions/mongo.so

jrborbars commented 9 years ago

Sorry. But I was expected that hhvm.dynamic_extensions[mongo] = mongo.so was the ONLY necessary config in php.ini. So, an update in the readme.md with this is necessary. ;-) Your advice was correct, since I was not added the /path/to/extensions/ to hhvm.dynamic_extensions[mongo]. Now, Mongofill works VERY WELL! Thank you so much.

digitalkaoz commented 9 years ago

should it be closed then? @jrborbars

jrborbars commented 9 years ago

Sorry. Closed succesfully.