Elegant Cassandra PHP client with TimeUUID and SuperColumnFamily support (port of pycassa)
hoan/phpcassa
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
master
Could not load branches
Nothing to show
Could not load tags
Nothing to show
{{ refName }}
default
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code
-
Clone
Use Git or checkout with SVN using the web URL.
Work fast with our official CLI. Learn more about the CLI.
- Open with GitHub Desktop
- Download ZIP
Sign In Required
Please sign in to use Codespaces.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
Notes: * Compatible with Cassandra 0.5.1 upwards (0.6.1) * Direct port of pycassa * Basic conversion of types (UUIDs to strings) Examples: * Including files: <?php // Copy all the files in this repository to your include directory. $GLOBALS['THRIFT_ROOT'] = dirname(__FILE__) . '/include/thrift/'; require_once $GLOBALS['THRIFT_ROOT'].'/packages/cassandra/Cassandra.php'; require_once $GLOBALS['THRIFT_ROOT'].'/transport/TSocket.php'; require_once $GLOBALS['THRIFT_ROOT'].'/protocol/TBinaryProtocol.php'; require_once $GLOBALS['THRIFT_ROOT'].'/transport/TFramedTransport.php'; require_once $GLOBALS['THRIFT_ROOT'].'/transport/TBufferedTransport.php'; include_once(dirname(__FILE__) . '/include/phpcassa.php'); include_once(dirname(__FILE__) . '/include/uuid.php'); ?> * Setting up nodes: <?php CassandraConn::add_node('192.168.1.1', 9160); CassandraConn::add_node('192.168.1.2', 5000); ?> * Create a column family object <?php $users = new CassandraCF('Keyspace1', 'Users'); // ColumnFamily $super = new CassandraCF('Keyspace1', 'SuperColumn', true); // SuperColumnFamily ?> * Inserting: <?php $users->insert('1', array('email' => 'hoan.tonthat@gmail.com', 'password' => 'test')); ?> * Querying: <?php $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: <?php $users->remove('1'); // removes whole object $users->remove('1', 'password'); // removes 'password' field ?> * Other: <?php $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. We also have a google group to ask questions: http://groups.google.com/group/phpcassa AUTHORS: * Hoan Ton-That (hoan.tonthat@gmail.com) * Benjamin Sussman (ben@fwix.com) * Anthony ROUX (anthony.rx43@gmail.com) * Vadim Derkach * Zach Buller (zachbuller@gmail.com) * Timandes * Todd Zusman * Yancho Georgiev (yancho@inspirestudio.net) * Pieter Maes (maescool@gmail.com)
About
Elegant Cassandra PHP client with TimeUUID and SuperColumnFamily support (port of pycassa)
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published