在codeigniter中使用phpcassandra

Hi I am new to cassandra database. I am trying to do a project in codeigniter with cassandra database. I have downloaded the phpcassandra files through below link https://github.com/mauritsl/php-cassandra.

When I am trying to autoload my casssandra.php in codeigniter I got Non-existent class: Cassandra error. Why I got this error and how to solve the issue?

You will need to create a wrapper for it if you wish to use it as a library.

I would suggest you take the composer route. You can check on packagist for a suitable library.

If you use this particular library phpcassa this is how you would go about getting it to work in Codeigniter.

composer.json

{
    "require": {
        "php": ">=5.3.0",
        "thobbs/phpcassa": "1.1.0"
    }

}

index.php

require "../composer/autoload.php";

system/core/codeigniter.php

// Where codeigniter starts to load the Main Controller
// $cassandraDB will be in the GLOBAL scope, so you may want to write a wrapper

$cassandraDB = new ConnectionPool('localhost');

// Then right after this
// if (class_exists('CI_DB') AND isset($CI->db))
// {
//      $CI->db->close();
// }

$cassandraDB->close();

User Model

implement it how you wish in your models

public function __construct()
{
    //YOU MAY NEED TO PASS $cassandraDB AS A DEPENDANCY!!

    $this->users = new ColumnFamily($cassandraDB, 'Standard1');
}