databox / databox
Official PHP client for Databox
Installs: 158 767
Dependents: 0
Suggesters: 0
Security: 0
Stars: 5
Watchers: 12
Forks: 9
Open Issues: 4
Requires
- php: >=5.5.0
- guzzlehttp/guzzle: ^6.1
Requires (Dev)
- codeclimate/php-test-reporter: ^0.2.0
- phpdocumentor/phpdocumentor: ^2.8
- phpunit/phpunit: ^4
This package is not auto-updated.
Last update: 2024-04-19 08:30:20 UTC
README
The PHP SDK for interacting with the Databox Push API.
Requirements
Autoloading
databox-php
uses Composer.
The first step to use databox-php
is to download composer:
$ curl -s http://getcomposer.org/installer | php
Clone the repo and install dependencies using:
$ git clone https://github.com/databox/databox-php.git && cd databox-php $ php composer.phar install
Use autoloader from Composer by:
{ "require": { "databox/databox": "@stable" } }
databox-php
follows the PSR-4 convention names for its classes, which means you can easily integrate databox-php
classes loading in your own autoloader.
Basic example
<?php require __DIR__ . '/vendor/autoload.php'; use Databox\Client; $c = new Client('<push_token>'); $ok = $c->push('sales', 203); if ($ok) { echo 'Inserted,...'; } $c->insertAll([ ['sales', 203], ['sales', 103, '2015-01-01 17:00:00'], ]); // Or push some attributes $ok = $c->push('sales', 203, null, [ 'city' => 'Boston' ]); print_r( $c->lastPush(3) ); // Or push with units $c->insertAll([ ['transaction', 12134, null, null, 'USD'], ['transaction', 3245, null, null, 'EUR'] ]);
Documentation
See the doc
directory for more detailed documentation.
License
databox-php
is licensed under the MIT License - see the LICENSE file for details.
Contributing
See the contribute guide for more info how to contribute.