I have released an initial commit for a PHP client that implements the CQL binary protocol. This is a work in progress but it is functional enough for you to send queries to a Cassandra cluster. I’m building tests first then implementing the functionality, so I should have decent test coverage when complete. The tests require a running Cassandra cluster, and they create a keyspace, column family, and columns and clean up when the tests are complete.
I’ll do additional posts about the functionality as I get more features implemented, and tests created.
It’s on Github – https://github.com/rmcfrazier/phpbinarycql so please check it out and if you see any issues open bugs.
Example
Included is a very simple example that shows how to connect and send a query.
$pbc->addStartupOption('CQL_VERSION', '3.0.4');
$queryText = 'select * from system.schema_keyspaces';
$response = $pbc->query($queryText, \McFrazier\PhpBinaryCql\CqlConstants::QUERY_CONSISTENCY_ONE);
// view the entire response object
var_dump($response);
Pingback: Getting started with the PHP Binary CQL client - blog.robert.mcfrazier.com
Funny to see two projects get launched at the same time with similar goal. https://github.com/mauritsl/php-cassandra
I wondered if anyone else was going to implement the protocol in PHP, nice job. We should collaborate, we could have a really good tool.
I wrote a PHP client for Cassandra, which uses a binary protocol.
Take a look and please vote my work on github. http://evseevnn.github.io/php-cassandra-binary/