2017 © Pedro PelĂĄez
 

library influx-php

Simple client for InfluxDB

image

libcast/influx-php

Simple client for InfluxDB

  • Tuesday, April 5, 2016
  • by libcast
  • Repository
  • 1 Watchers
  • 1 Stars
  • 3,124 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 32 Forks
  • 0 Open issues
  • 2 Versions
  • 8 % Grown

The README.md

InfluxDB Build Status

Simple PHP client for InfluxDB, an open-source, distributed, time series, events, and metrics database with no external dependencies., (*1)

How to install it

The easiest way is to install it via composer, (*2)

composer require crodas/influx-php:\*

How to use it

You need to create a client object., (*3)

$client = new \crodas\InfluxPHP\Client(
   "localhost" /*default*/,
   8086 /* default */,
   "root" /* by default */,
   "root" /* by default */
);

The first time you should create an database., (*4)

$db = $client->createDatabase("foobar");
$db->createUser("foo", "bar"); // <-- create user/password

Create data is very simple., (*5)

$db = $client->foobar;
$db->insert("some label", ['foobar' => 'bar']); // single input
$db->insert("some label", [
    ['foobar' => 'bar'],
    ['foobar' => 'foo'],
]); // multiple input, this is better :-)

Now you can get the database object and start querying., (*6)

$db = $client->foobar;
// OR
$db = $client->getDatabase("foobar");

foreach ($db->query("SELECT * FROM foo;") as $row) {
    var_dump($row, $row->time);
}

The Versions

05/04 2016

dev-master

9999999-dev

Simple client for InfluxDB

  Sources   Download

BSD-4-Clause

by César D. Rodas

05/04 2016

v0.8.2

0.8.2.0

Simple client for InfluxDB

  Sources   Download

BSD-4-Clause

by César D. Rodas