clusterpoint / php-client-api-v4
Installs: 2 030
Dependents: 2
Suggesters: 0
Security: 0
Stars: 2
Watchers: 6
Forks: 4
Open Issues: 0
Requires
- php: >=5.4
- ext-curl: *
Requires (Dev)
- php: >=5.5
- phpspec/phpspec: ~2.0
README
Clusterpoint is a NoSQL document database known for its innovative Cloud-based distributed architecture, fast processing speed, and a flexible "pay as you use" pricing model. The database also features a developer-friendly API suitable for many popular modern programming languages, including PHP -- the specific API which is the focus of this document. Its full support for ACID-compliant transactions is a rarity among NoSQL databases, making the product useful for situations where data integrity is a must.
The recently introduced fourth edition of Clusterpoint added a unique JavaScript/SQL query language with computational capabilities,, allowing you to create powerful queries to store, retrieve, and transform data. The PHP API is flexible enough to allow you to use either interface methods or raw JS/SQL queries to accomplish your database tasks. The decision to use either approach ultimately depends on programmer preference and the individual development scenario.
Clusterpoint 4.x PHP Client API
Official Documentation
Documentation for the API can be found on the Clusterpoint website.
Requirements
PHP >= 5.4.0
cURL PHP Extension
Composer
Getting Started
- Sign up for Clusterpoint – Before you begin, you need to sign up for a Clusterpoint account and retrieve your Clusterpoint credentials.
- Minimum requirements – To run the PHP Client API, your system will need to meet the minimum requirements, including having **PHP >= 5.4.0 compiled with the cURL extension and cURL 4.0.2+.
- Install the API – Composer is the right way to install the PHP Client API.
composer require clusterpoint/php-client-api-v4
- Publish config file - this is optional step, you can pass access points during workflow, but this might make your development process easier.
php -r "copy('vendor/clusterpoint/php-client-api-v4/src/config.example', 'clusterpoint.php');"
- Access – You can pass the credentials inside on
Clusterpoint\Client
class construction, or use clusterpoint.php inside your project root folder, to manage your access points.
Quick Example
<?php require 'vendor/autoload.php'; // or if you installed api without composer: // require 'api_install_folder/Clusterpoint.php' use Clusterpoint\Client; //Initialize the service $cp = new Client([ 'host' => 'https://api-eu.clusterpoint.com/v4', 'account_id' => '1', 'username' => 'root', 'password' => 'password', 'debug' => true, ]); // Set the database.collection to initalize the query builder for it. $bikes = $cp->database("shop.bikes"); // Build your query $results = $bikes->where('color', 'red') ->where('availability', true) ->limit(5) ->groupBy('category') ->orderBy('price') ->select(['name', 'color', 'price', 'category']) ->get(); // Access your results echo "First bike price: ".$results[0]->price;
Support, Feature Requests & Bug Reports
- GitHub issues for bug reports and feature requests
- StackOverflow to ask questions (please make sure to use the clusterpoint tag)
- You can also send an e-mail to our support team at support@clusterpoint.com
License
Clusterpoint 4.x PHP Client API is open-sourced software licensed under the MIT license