Giter Site home page Giter Site logo

mongodb-labs / mongo-hhvm-driver-unsupported Goto Github PK

View Code? Open in Web Editor NEW
56.0 40.0 6.0 277 KB

[Archive] Experimental MongoDB driver for HHVM - This Repository is NOT a supported MongoDB product

License: Apache License 2.0

Shell 1.48% C++ 39.06% PHP 10.40% CMake 0.94% Hack 48.13%
mongodb-driver hhvm

mongo-hhvm-driver-unsupported's Introduction

Note: This repository is unsupported and no longer under active development. Please see mongodb/mongo-hhvm-driver for our official HHVM driver.


DISCLAIMER

Please note: all tools/ scripts in this repo are released for use "AS IS" without any warranties of any kind, including, but not limited to their installation, use, or performance. We disclaim any and all warranties, either express or implied, including but not limited to any warranty of noninfringement, merchantability, and/ or fitness for a particular purpose. We do not warrant that the technology will meet your requirements, that the operation thereof will be uninterrupted or error-free, or that any errors will be corrected. Any use of these scripts and tools is at your own risk. There is no guarantee that they have been through thorough testing in a comparable environment and we are not responsible for any damage or data loss incurred with their use. You are responsible for reviewing and testing any scripts you run thoroughly before use in any non-testing environment.

MongoDB driver for HHVM

This is an implementation of the MongoDB PHP driver for HHVM. It is not feature-complete and should be considered experimental.

This project is not officially supported and GitHub issues have been disabled.

Dependencies

Compiling this extension requires the following libraries:

  • HHVM (>=3.1.0) must be compiled from source, since the binary distributions of HHVM do not include necessary development headers. Instructions for compiling HHVM may be found here.

  • libmongoc (>=0.94.0) and its corresponding libbson dependency must be installed as a system library. Instructions for installing libmongoc may be found here.

Building and installation

Ensure that the HPHP_HOME environment variable is set to the HHVM project directory. This should be the path to the cloned HHVM git repository where you compiled the project.

$ export HPHP_HOME=/path/to/hhvm

Execute this project's build.sh script:

$ ./build.sh

This script checks for the HHVM path, executes hphpize to prepare the build process, and finally executes cmake and make to compile the extension.

The build process will produce a mongo.so file, which can then be dynamically loaded by HHVM by adding the following to HHVM's config.hdf file:

DynamicExtensions {
  mongo = /path/to/mongo.so
}

This example is taken from the Extension API documentation.

Note that the mongo key in this example is a placeholder; HHVM only cares that the path to the mongo.so file is correct. You may notice that in our test script, we use 0 as a key when specifying our extension via the command line.

Tests

The test suite is implemented with PHPUnit and may be executed via the test.sh script:

$ ./test.sh

The test script depends on the HPHP_HOME environment variable and will attempt to locate PHPUnit via the which command, so ensure that the phpunit binary is installed in an executable path.

Interactive Mode

To try out this work in progress for yourself, you can run the extension in interactive mode on HipHop VM via the interactive_mode.sh script:

$ ./interactive_mode.sh

Once in interactive mode, you can execute queries and all implemented methods on your existing local databases. For example, if a test database exists with a students collection, I can access one document in that collection by running the following commands:

hphpd> $cli = new MongoClient();
hphpd> $db = $cli->selectDB('test');
hphpd> $coll = $db->selectCollection('students');
hphpd> $cur = $coll->find()->limit(1);
hphpd> $cur->rewind();
hphpd> var_dump($cur->current());

Credits

Máximo Cuadros created the src/contrib/encode.h, src/contrib/encode.cpp and src/contrib/classes.h files.

mongo-hhvm-driver-unsupported's People

Contributors

alisan16 avatar aparnapande92 avatar bc385 avatar derickr avatar jmikola avatar mgentili avatar snowbabyjia avatar yf225 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.