Skip to content

kaisung/aerospike-client-hhvm

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Aerospike HHVM Client

This is a prototype of an Aerospike client implemented as a HHVM Native Interface extension.

Currently builds on 64-bit Ubuntu 14.04 LTS against HHVM 3.9.1, with the aerospike C client release 3.1.16. We intend to support HHVM LTS releases.

Documentation

Documentation of the Aerospike HHVM Client may be found in the doc directory. The API described there is the specification for the PHP Client. Notes on the internals of the implementation are in doc/internals.md.

Example PHP code can be found in the examples/ directory.

Full documentation of the Aerospike database is available at http://www.aerospike.com/docs/

Install HHVM

sudo apt-get install software-properties-common
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0x5a16e7281be7a449
sudo add-apt-repository "deb http://dl.hhvm.com/ubuntu trusty-lts-3.9 main"
sudo apt-get update
sudo apt-get install -y hhvm
sudo apt-get install -y hhvm-dev

Install HHVM on Other Distros

The HHVM manual provides prebuilt packages for different distributions. You need to install the hhvm and hhvm-dev packages.

HHVM requires g++ >= 4.8. The individual distribution links in the Distro Building Instructions article explain how to upgrade to this version in older distros such as Debian 7.

Install Aerospike C client

Get the 3.1.16 release of the Aerospike C Client library, and install the development package contained in the tar archive.

For example, on Ubuntu 14.04:

wget -O aerospike-c-client.tgz http://www.aerospike.com/download/client/c/3.1.16/artifact/ubuntu12
tar zxvf aerospike-c-client.tgz
cd aerospike-client-c-3.1.16.ubuntu12.04.x86_64
sudo dpkg -i aerospike-client-c-devel-3.1.16.ubuntu12.04.x86_64.deb

Build and Install the Aerospike HHVM Client

In the cloned repo:

cd src/aerospike
hphpize
cmake . && make
sudo make install

The make install step should state the path where the extension is installed. You will use that path in the next step (Configure). On Ubuntu you will often see the following:

-- Installing: /usr/lib/x86_64-linux-gnu/hhvm/extensions/20150212/aerospike-hhvm.so

Troubleshooting

If during the build you see an error that complains about the location of Aerospike header files (for example, fatal error: aerospike/aerospike_key.h: No such file or directory) you will need to edit the config.cmake file.

  • Edit the target_link_libraries to the path containing the C client (libaerospike.so).
  • Edit include_directories to the directory which contains the C client's header files.

Configure HHVM to Load the Extension

Add the extension to HHVM by editing /etc/hhvm/php.ini as follows:

hhvm.extensions[] = /path/to/aerospike-hhvm.so

On Ubuntu this is often:

hhvm.extensions[] = /usr/lib/x86_64-linux-gnu/hhvm/extensions/20150212/aerospike-hhvm.so

Test

Run the unit tests as described in the tests section README.

About

Aerospike Client for HHVM

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 69.9%
  • C++ 28.1%
  • Other 2.0%