From 7f4f2b5f2cc3c382d121f461e06324fabb891fc3 Mon Sep 17 00:00:00 2001 From: Walter Dal Mut Date: Sat, 13 Sep 2014 11:47:21 +0200 Subject: [PATCH] Removed old docs and moved install procedures --- README.md | 69 ++++++++++++++++--------------------------------------- 1 file changed, 20 insertions(+), 49 deletions(-) diff --git a/README.md b/README.md index 2c19815cc..2e83db0d5 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,25 @@ Send metrics to InfluxDB and query for any data. +## Install it + +Just use composer + +```shell +php composer.phar require corley/influxdb-sdk:dev-master +``` + +Or place it in your require section + +```json +{ + "require": { + // ... + "corley/influxdb-sdk": "dev-master" + } +} +``` + Add new points: ```php @@ -58,7 +77,7 @@ $client->setAdapter($adapter); Effectively the client creation is not so simple, for that reason you can you the factory method provided with the library. -``` +```php $options = [ "adapter" => [ "name" => "InfluxDB\\Adapter\\GuzzleAdapter", @@ -147,51 +166,3 @@ $client->deleteDatabase("my.name"); // delete an existing database with name "my Actually only queryable adapters can handle databases (implements the `QueryableInterface`) -## Install it - -Just use composer - -```shell -php composer.phar require corley/influxdb-sdk:dev-master -``` - -Or place it in your require section - -```json -{ - "require": { - // ... - "corley/influxdb-sdk": "dev-master" - } -} -``` - - -## Prepare lib dependencies - -Use your DiC or Service Locator in order to provide a configured client - -```php -setHost("analytics.mine.domain.tld"); -$options->setPort(8086); -$options->setUsername("root"); -$options->setPassword("root"); -$options->setDatabase("mine"); - -$guzzleHttp = new GuzzleHttpClient(); -$adapter = new InfluxHttpAdapter($guzzleHttp, $options); - -$influx = new Client(); -$influx->setAdapter($adapter); - -$influx->mark("tcp.test", ["mark" => "element"]); -``` -