Download the PHP package crodas/influx-php without Composer
On this page you can find all versions of the php package crodas/influx-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package influx-php
InfluxDB
Simple PHP client for InfluxDB, an open-source, distributed, time series, events, and metrics database with no external dependencies.
InfluxDB > v0.9 support
The 0.2.0 version of this library now supports InfluxDB 0.9. Please note that InfluxDB 0.9 is still pre-release software.
InfluxDB v0.8.X users
Influxdb >=0.9.0 brings many breaking changes to the API. InfluxDB 0.8.X users may use the legacy client by using the 0.1. series instead. For the documentation, please have a look at the 0.1. version!
How to install it
The easiest way is to install it via composer
Create a composer.json file with the following contents:
With InfluxDB 0.9 and above:
With InfluxDB 0.8.*:
How to use it
You need to create a client object.
The first time you should create an database.
You can create more users than the default root user.
Show existing users:
User privileges are controlled by per-databases users. Any user can have 'read', 'write' or 'all' access, represented by the constants InfluxClient::PRIV_READ, InfluxClient::PRIV_WRITE and InfluxClient::PRIV_ALL.
The cluster administrator can be set with:
Create data is very simple.
It is recommended that you encode most metadata into the series Tags.
Now you can get the database object and start querying.
If there are multiple result series, a MultipleResultSeriesObject instance will be returned. So if you are not sure about the results of the query, check the type of the returned object.
An example of getting multiple result sets is:
Please have a look at the DBTest.php class, you will find some more examples there.