Elegant Cassandra PHP client with TimeUUID and SuperColumnFamily support (port of pycassa)
PHP C++
Switch branches/tags
Nothing to show
Pull request Compare This branch is 34 commits behind hoan:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
thrift
README
phpcassa.php
uuid.php

README

Notes:

* Cassandra 0.5
* Direct port of pycassa
* Basic conversion of types (UUIDs to strings)

Examples:

* Setting up nodes:

CassandraConn::add_node('192.168.1.1', 9160);
CassandraConn::add_node('192.168.1.2', 5000);

* Create a column family object

$users = new CassandraCF('Keyspace1', 'Users'); // ColumnFamily
$super = new CassandraCF('Keyspace1', 'SuperColumn', true); // SuperColumnFamily

* Inserting:

$users->insert('1', array('email' => 'hoan.tonthat@gmail.com', 'password' => 'test'));

* Querying:

$users->get('1'); // array('email' => 'hoan.tonthat@gmail.com', 'password' => 'test')
$users->multiget(array('1', '2')); // array('1' => array('email' => 'hoan.tonthat@gmail.com', 'password' => 'test'))

* Removing:

$users->remove('1'); // removes whole object
$users->remove('1', 'password'); // removes 'password' field

* Other:

$users->get_count('1'); // counts the number of columns in user 1 (in this case 2)
$users->get_range('1', '10'); // gets all users between '1' and '10'

Email hoan.tonthat@gmail.com with any questions