Download the PHP package simlux/influxdb-php without Composer

On this page you can find all versions of the php package simlux/influxdb-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package influxdb-php

influxdb-php

InfluxDB client library for PHP

Build Status Code Climate Test Coverage

Overview

A easy to use library for using InfluxDB with PHP. Maintained by @thecodeassassin, @gianarb.

The influxdb-php library was created to have php port of the python influxdb client. This way there will be a common abstraction library between different programming languages.

Installation

Installation can be done with composer:

NOTE for PHP 5.3 and PHP 5.4 users

If you use either PHP 5.3 and PHP 5.4, the 0.1.x release is still supported (bug fixes and new release fixes). The 0.1.x branch will work on PHP 5.3 and PHP 5.4 but doesn't contain all the features that the 1.0.0 release has such as UDP support.

Getting started

Initialize a new client object:

This will create a new client object which you can use to read and write points to InfluxDB.

It's also possible to create a client from a DSN (Data Source Name):

Reading

To fetch records from InfluxDB you can do a query directly on a database:

It's also possible to use the QueryBuilder object. This is a class that simplifies the process of building queries.

Make sure that you enter single quotes when doing a where query on strings; otherwise InfluxDB will return an empty result.

You can get the last executed query from the client:

Writing data

Writing data is done by providing an array of points to the writePoints method on a database:

It's possible to add multiple fields when writing measurements to InfluxDB. The point class allows one to easily write data in batches to influxDB.

The name of a measurement and the value are mandatory. Additional fields, tags and a timestamp are optional. InfluxDB takes the current time as the default timestamp.

You can also write multiple fields to a measurement without specifying a value:

Writing data using udp

First, set your InfluxDB host to support incoming UDP sockets:

Then, configure the UDP driver in the client:

Or simply use a DSN (Data Source Name) to send metrics using UDP:

Note: It is import to note that precision will be ignored when you use UDP. You should always use nanosecond precision when writing data to InfluxDB using UDP.

Timestamp precision

It's important to provide the correct precision when adding a timestamp to a Point object. This is because if you specify a timestamp in seconds and the default (nanosecond) precision is set; the entered timestamp will be invalid.

Please note that exec('date + %s%N') does NOT work under MacOS; you can use PHP's microtime to get a timestamp with microsecond precision, like such:

Creating databases

When creating a database a default retention policy is added. This retention policy does not have a duration so the data will be flushed with the memory.

This library makes it easy to provide a retention policy when creating a database:

You can also alter retention policies:

and list them:

You can add more retention policies to a database:

Client functions

Some functions are too general for a database. So these are available in the client:

Admin functionality

You can use the client's $client->admin functionality to administer InfluxDB via the API.

List all the users:

Granting and revoking privileges

Granting permissions can be done on both the database level and cluster-wide. To grant a user specific privileges on a database, provide a database object or a database name.

Todo

Changelog

1.14.3

1.14.2

1.4.1

1.4.0

1.3.1

1.3.0

1.2.2

1.2.0

1.1.3

1.1.2

1.1.1

1.1.0

1.0.1

1.0.0

0.1.2

0.1.1


All versions of influxdb-php with dependencies

PHP Build Version
Package Version
Requires php Version ^5.5 | ^7.0
guzzlehttp/guzzle Version 6.*
symfony/event-dispatcher Version 2.*|3.*
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package simlux/influxdb-php contains the following files

Loading the files please wait ....