Coder Social home page Coder Social logo

php-hyperdex's Introduction

php-hyperdex
=============
The hyperdex extension provides an API for communicating with the Hyperdex key-value store. 
It is released under the [PHP License, version 3.01](http://www.php.net/license/3_01.txt).

This code has been developed and maintained by Triton Digital Media, and provided to the open 
source community as a "thank you". We use open source software in our business, and feel that it 
is only right to give back whenever we can.

For more information on Hyperdex, please see http://hyperdex.org/


For comments, or issues, please contact [email protected]

Note: This code is no longer being maintained. For updated versions, please see https://github.com/bbroerman30/php-hyperdex

Installing/Configuring
======================

<pre>
phpize
./configure --enable-hyperdex
make
make install
</pre>

`make install` copies `hyperdex.so` to an appropriate location, but you still need to enable the module in the PHP config file. To do so, either edit your php.ini or add a redis.ini file in `/etc/php5/conf.d` with the following contents: `extension=hyperdex.so`.

You can generate a debian package for PHP5, accessible from Apache 2 by running `./mkdeb-apache2.sh` or with `dpkg-buildpackage` or `svn-buildpackage`.

This extension exports a single class, hyperclient (and `HyperDexException` used in case of errors).


Usage
====================

The hyperclient exposes the following methods:

Boolean hyperclient::connect( string host, int port )
Boolean hyperclient::disconnect()

Boolean hyperclient::put( String space, String key, Array attributes )
Boolean hyperclient::put_attr( String space, String key, String attr_name, Mixed value )
Boolean hyperclient::condput( String space, String key, Array conditionals, Array attributes )

Boolean hyperclient::lpush( String space, String key, Array attributes )
Boolean hyperclient::rpush( String space, String key, Array attributes )

Boolean hyperclient::set_add( String space, String key, Array attributes )
Boolean hyperclient::set_remove( String space, String key, Array attributes )
Boolean hyperclient::set_union( String space, String key, Array attributes )
Boolean hyperclient::set_intersect( String space, String key, Array attributes )

Boolean hyperclient::add( String space, String key, Array attributes )
Boolean hyperclient::sub( String space, String key, Array attributes )
Boolean hyperclient::mul( String space, String key, Array attributes )
Boolean hyperclient::div( String space, String key, Array attributes )
Boolean hyperclient::mod( String space, String key, Array attributes )
Boolean hyperclient::and( String space, String key, Array attributes )
Boolean hyperclient::or( String space, String key, Array attributes )
Boolean hyperclient::xor( String space, String key, Array attributes )

Array hyperclient::search( String space, Array cond_attrs, Array range_attrs )

Array hyperclient::get( String space, String key )
Mixed hyperclient::get_attr( String space, String key, String attr_name )

Boolean hyperclient::del( String space, String key )



Example:
=========

$hdp = new hyperclient('127.0.0.1', 1234);

$val = $hdp->put( 'phonebook','jsmith1', array( 'first' => 'Brad', 'last' => 'Broerman', 'phone' => 123456 ) );

$val = $hdp->get( 'phonebook','jsmith1' );

var_dump( $val );

php-hyperdex's People

Contributors

bbroerman30 avatar

Watchers

 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.