A easy to use library for using InfluxDB with PHP.

Overview

influxdb-php

InfluxDB client library for PHP

Build Status Code Climate Test Coverage

Note: This library is for use with InfluxDB 1.x. For connecting to InfluxDB 2.x instances, please use the influxdb-client-php client.

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:

$ composer require influxdb/influxdb-php

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:

$client = new InfluxDB\Client($host, $port);

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):

// directly get the database object
$database = InfluxDB\Client::fromDSN(sprintf('influxdb://user:pass@%s:%s/%s', $host, $port, $dbname));

// get the client to retrieve other databases
$client = $database->getClient();

Important: don't forget to urlencode() the password (and username for that matter) when using a DSN, especially if it contains non-alphanumeric characters. Not doing so might cause exceptions to be thrown.

Reading data

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

// fetch the database
$database = $client->selectDB('influx_test_db');

// executing a query will yield a resultset object
$result = $database->query('select * from test_metric LIMIT 5');

// get the points from the resultset yields an array
$points = $result->getPoints();

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

getQuery();">
// retrieve points with the query builder
$result = $database->getQueryBuilder()
	->select('cpucount')
	->from('test_metric')
	->limit(2)
	->offset(2)
	->getResultSet()
	->getPoints();

// get the query from the QueryBuilder
$query = $database->getQueryBuilder()
	->select('cpucount')
	->from('test_metric')
	->where(["region = 'us-west'"])
	->getQuery();

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:

// use the getLastQuery() method
$lastQuery = $client->getLastQuery();

// or access the static variable directly:
$lastQuery = Client::lastQuery;

Reading data using a timeout

In production if you are querying InfluxDB to generate a response to a web or API request, you may want to set a specific timeout for InfluxDB calls rather than the default of letting them run indefinitely.

// Fetch the database using a 5 second time out
$database = InfluxDB\Client::fromDSN(sprintf('influxdb://user:pass@%s:%s/%s', $host, $port, $dbname), 5);

Writing data

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

// create an array of points
$points = array(
	new Point(
		'test_metric', // name of the measurement
		0.64, // the measurement value
		['host' => 'server01', 'region' => 'us-west'], // optional tags
		['cpucount' => 10], // optional additional fields
		1435255849 // Time precision has to be set to seconds!
	),
    new Point(
    	'test_metric', // name of the measurement
		0.84, // the measurement value
		['host' => 'server01', 'region' => 'us-west'], // optional tags
		['cpucount' => 10], // optional additional fields
		1435255849 // Time precision has to be set to seconds!
	)
);

// we are writing unix timestamps, which have a second precision
$result = $database->writePoints($points, Database::PRECISION_SECONDS);

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:

$points = [
	new Point(
		'instance', // the name of the measurement
		null, // measurement value
		['host' => 'server01', 'region' => 'us-west'], // measurement tags
		['cpucount' => 10, 'free' => 1], // measurement fields
		exec('date +%s%N') // timestamp in nanoseconds on Linux ONLY
	),
	new Point(
		'instance', // the name of the measurement
		null, // measurement value
		['host' => 'server01', 'region' => 'us-west'], // measurement tags
		['cpucount' => 10, 'free' => 2], // measurement fields
		exec('date +%s%N') // timestamp in nanoseconds on Linux ONLY
	)
];

Writing data using udp

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

[udp]
  enabled = true
  bind-address = ":4444"
  database = "test_db"

Then, configure the UDP driver in the client:

// set the UDP driver in the client
$client->setDriver(new \InfluxDB\Driver\UDP($client->getHost(), 4444));

$points = [
	new Point(
		'test_metric',
		0.84,
		['host' => 'server01', 'region' => 'us-west'],
		['cpucount' => 10],
		exec('date +%s%N') // this will produce a nanosecond timestamp on Linux ONLY
	)
];

// now just write your points like you normally would
$result = $database->writePoints($points);

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

// get a database object using a DSN (Data Source Name)
$database = \InfluxDB\Client::fromDSN('udp+influxdb://username:pass@localhost:4444/test123');

// write your points
$result = $database->writePoints($points);

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.

// Points will require a nanosecond precision (this is default as per influxdb standard)
$newPoints = $database->writePoints($points);

// Points will require second precision
$newPoints = $database->writePoints($points, Database::PRECISION_SECONDS);

// Points will require microsecond precision
$newPoints = $database->writePoints($points, Database::PRECISION_MICROSECONDS);

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:

list($usec, $sec) = explode(' ', microtime());
$timestamp = sprintf('%d%06d', $sec, $usec*1000000);

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:

// create the client
$client = new \InfluxDB\Client($host, $port, '', '');

// select the database
$database = $client->selectDB('influx_test_db');

// create the database with a retention policy
$result = $database->create(new RetentionPolicy('test', '5d', 1, true));

// check if a database exists then create it if it doesn't
$database = $client->selectDB('test_db');

if (!$database->exists()) {
	$database->create(new RetentionPolicy('test', '1d', 2, true));
}

You can also alter retention policies:

$database->alterRetentionPolicy(new RetentionPolicy('test', '2d', 5, true));

and list them:

$result = $database->listRetentionPolicies();

You can add more retention policies to a database:

$result = $database->createRetentionPolicy(new RetentionPolicy('test2', '30d', 1, true));

Client functions

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

// list users
$result = $client->listUsers();

// list databases
$result = $client->listDatabases();

Admin functionality

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

// add a new user without privileges
$client->admin->createUser('testuser123', 'testpassword');

// add a new user with ALL cluster-wide privileges
$client->admin->createUser('admin_user', 'password', \InfluxDB\Client\Admin::PRIVILEGE_ALL);

// drop user testuser123
$client->admin->dropUser('testuser123');

List all the users:

// show a list of all users
$results = $client->admin->showUsers();

// show users returns a ResultSet object
$users = $results->getPoints();

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.

// grant permissions using a database object
$database = $client->selectDB('test_db');
$client->admin->grant(\InfluxDB\Client\Admin::PRIVILEGE_READ, 'testuser123', $database);

// give user testuser123 read privileges on database test_db
$client->admin->grant(\InfluxDB\Client\Admin::PRIVILEGE_READ, 'testuser123', 'test_db');

// revoke user testuser123's read privileges on database test_db
$client->admin->revoke(\InfluxDB\Client\Admin::PRIVILEGE_READ, 'testuser123', 'test_db');

// grant a user cluster-wide privileges
$client->admin->grant(\InfluxDB\Client\Admin::PRIVILEGE_READ, 'testuser123');

// Revoke an admin's cluster-wide privileges
$client->admin->revoke(\InfluxDB\Client\Admin::PRIVILEGE_ALL, 'admin_user');

Todo

  • More unit tests
  • Increase documentation (wiki?)
  • Add more features to the query builder
  • Add validation to RetentionPolicy

Changelog

1.15.0

  • Added cURL driver support #122 (thanks @aldas)
  • Improved query error message #129 (thanks @andreasanta)

1.14.8

  • Merged #122

1.14.7

  • Added offset in QueryBuilder (thanks @lifekent and @BentCoder)

1.14.6

  • dependencies update (#97), by @aldas
  • Adding timeout information. (#103), by @NickBusey
  • Add ability to specify connect_timeout for guzzle (#105), by @brycefranzen

1.14.5

  • Update key concepts link to point to the proper place.
  • Replace costly array_merge calls with foreach + array operator
  • Add getter method for verifySSL
  • Support for Symfony 4

1.14.3

  • Deprecate IF NOT EXISTS clause in database creation

1.14.2

  • Fix Notice when calling InfluxDB\Client::fromDSN without username or password
  • fixed Guzzle client timeout is float
  • Fix annotation
  • Remove unused property
  • Fixed misspelling
  • Fixed tag with Boolean/Null value trigger parse error

1.4.1

  • Fixed bug: Escape field values as per line protocol.

1.4.0

  • Updating Influx Database with support for writing direct payloads, thanks @virgofx

1.3.1

  • Added ability to write data to a specific retention policy, thanks @virgofx !

1.3.0

  • Added quoting of dbname in queries
  • Added orderBy to query builder
  • Fixed wrong orderby tests
  • Travis container-infra and php 7

1.2.2

  • Fixed issue with listUsers() method
  • Added more unit tests
  • Added getColumns method to \InfluxDB\ResultSet

1.2.0

  • Added support for 32 bit systems
  • Added setters/getters for Point fields

1.1.3

  • Added support for symfony3

1.1.2

  • Fixed issue with authentication when writing data

1.1.1

  • Added support for 0.9.4
  • Added if not exists support to database->create()
  • Added getLastQuery method

1.1.0

  • Added support for 0.9.3 rc2
  • Changed the way we handle the datatypes of values
  • Changed list retention policies to reflect the changes in 0.9.3

1.0.1

  • Added support for authentication in the guzzle driver
  • Added admin functionality

1.0.0

  • -BREAKING CHANGE- Dropped support for PHP 5.3 and PHP 5.4
  • Allowing for custom drivers
  • UDP support

0.1.2

  • Added exists method to Database class
  • Added time precision to database class

0.1.1

  • Merged repository to influxdb/influxdb-php
  • Added unit test for createRetentionPolicy
  • -BREAKING CHANGE- changed $client->db to $client->selectDB
Comments
  • Exception on GuzzleHttp fopen on Debian 8.0 AMD64 and InfluxDB 0.12.2

    Exception on GuzzleHttp fopen on Debian 8.0 AMD64 and InfluxDB 0.12.2

    I'm having issue not able to create a database object where a exception is thrown:

    os: Debian 8.4 AMD64 jessie
    php-cli (from debian repo): PHP 5.6.20-0+deb8u1 (cli) (built: Apr 27 2016 11:26:05)
    influxdb (from influxdata repo): 0.12.2
    

    The snippet (the demo as the README.md):

    <?php
            require_once "vendor/autoload.php";
    
            use InfluxDB\Client;
            use InfluxDB\Point;
            use InfluxDB\Database;
    
            $host = "localhost";
            $port = 8086;
            $user = "endurance";
            $pass = "endurance";
            $dbname = "endurance";
    
            $client = new InfluxDB\Client($host, $port);
            $db = $client->selectDB($dbname);
    
            // create an array of points
            $points = array(
                    new Point(
                            'test_metric', // name of the measurement
                            0.64, // the measurement value
                            ['host' => 'server01', 'region' => 'us-west'], // optional tags
                            ['cpucount' => 10], // optional additional fields
                            1435255849 // Time precision has to be set to seconds!
                    ),
                    new Point(
                    'test_metric', // name of the measurement
                            0.84, // the measurement value
                            ['host' => 'server01', 'region' => 'us-west'], // optional tags
                            ['cpucount' => 10], // optional additional fields
                            1435255849 // Time precision has to be set to seconds!
                    )
            );
    
            // we are writing unix timestamps, which have a second precision
            $result = $db->writePoints($points, Database::PRECISION_SECONDS);
    ?>
    

    The error:

    PHP Fatal error:  Uncaught exception 'InfluxDB\Exception' with message 'Error creating resource: [message] fopen(http://localhost:8086/write?db=endurance&precision=s): failed to open stream: HTTP request failed!
    [file] /vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php
    [line] 287' in vendor/influxdb/influxdb-php/src/InfluxDB/Database.php:144
    Stack trace:
    #0 writetest.php(36): InfluxDB\Database->writePoints(Array, 's')
    #1 {main}
      thrown in vendor/influxdb/influxdb-php/src/InfluxDB/Database.php on line 144
    

    I actually see something flowing on the wire, while still the exception is thrown....:

    $ sudo tcpflow -i lo -c  'port 8086'
    tcpflow: listening on lo
    ::1.45219-::1.08086: POST /write?db=endurance&precision=s HTTP/1.1
    
    ::1.45219-::1.08086: Content-Length: 151
    User-Agent: GuzzleHttp/6.2.0 PHP/5.6.20-0+deb8u1
    Host: localhost:8086
    Connection: close
    Content-Type:
    ::1.45219-::1.08086:
    
    ::1.45219-::1.08086:
    
    ::1.45219-::1.08086: test_metric,host=server01,region=us-west cpucount=10i,value=0.64 1435255849
    test_metric,host=server01,region=us-west cpucount=10i,value=0.84 1435255849
    ::1.08086-::1.45219: HTTP/1.1 204 No Content
    Request-Id: be4c3e00-0dfa-11e6-aeba-000000000000
    X-Influxdb-Version: 0.12.2
    Date: Fri, 29 Apr 2016 11:08:46 GMT
    Connection: close
    

    Maybe someone can test this also on a vanilla debian, as we digged deep into the GuzzleHttp lib and had no clue...

    bug 
    opened by xor-gate 18
  • Adding new points in intuitive manner

    Adding new points in intuitive manner

    Seems more intuitive to me how https://github.com/corley/influxdb-php-sdk is adding new points:

    $client->mark([
        "tags" => [
            "dc" => "eu-west-1",
        ],
        "points" => [
            [
                "measurement" => "instance",
                "fields" => [
                    "cpu" => 18.12,
                    "free" => 712423,
                ],
            ],
        ]
    ]);
    

    Compared to what we have in the README example here:

        $points = array(
            new Point(
                'test_metric',
                0.64,
                array('host' => 'server01', 'region' => 'us-west'),
                array('cpucount' => 10),
                1435255849
            )
        );
    
        $newPoints = $database->writePoints($points, Database::PRECISION_SECONDS);
    

    Can we do the same on this repo? It is relatively hard for someone to understand InfluxDB from your example while example at the top makes it much easier. I, myself, don't even know how to rewrite example at the to work with this library.

    opened by skynet 15
  • Delay driver instantiation until it's actually needed.

    Delay driver instantiation until it's actually needed.

    This essentially removes the dependency on Guzzle if you use an alternative driver implementation. "Essentially" since the tests are pretty hard-wired to Guzzle, but runtime-wise it wouldn't be needed anymore.

    opened by pprkut 11
  • An interesting starting point?

    An interesting starting point?

    Hi! Thanks for your job at InfluxDB, it is a nice tool!

    We use it in ours applications written in PHP. I'm here to underline ours influxdb-php-sdk and to submit it to influxdb community. This SDK now support UDP and TPC (Guzzle) protocols but exist standard interface to write your implementation. It's fully tested and very simple to use it and extendable.

    1. Use composer to manage dependency
    composer require corley/influxdb-sdk
    
    1. Create your client
    $options = new Options();
    $adapter = new UdpAdapter($options);
    
    $client = new Client();
    $client->setAdapter($adapter);
    
    1. Mark your points
    $client->mark("app.search", [
        "key" => "this is my search"
    ]);
    

    It's very integrable with dependency injection containers like SymfonyDiC or any other framework.

    See README.md

    What do you think about it?

    opened by gianarb 10
  • Failed to show database when calling exists()

    Failed to show database when calling exists()

    When calling exists() to check a DB, PHP will throw fatal error:

    PHP Fatal error: Uncaught exception 'RuntimeException' with message 'Error creating resource: [message] fopen(http://127.0.0.1:8086/query?q=SHOW+DATABASES): failed to open stream: HTTP request failed! [file] /project/lib/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php [line] 282' in /project/lib/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php:222 Stack trace: #0 /project/lib/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php(286): GuzzleHttp\Handler\StreamHandler->createResource(Object(Closure)) #1 /project/lib/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php(52): GuzzleHttp\Handler\StreamHandler->createStream(Object(GuzzleHttp\Psr7\Request), Array) #2 /project/lib/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php(42): GuzzleHttp\Handler\StreamHandler->__invoke(Object(GuzzleHttp\Psr7\Request), Array) #3 /project/lib/vendor/guzzlehttp/guzzle/src/Middleware.php(30): GuzzleHttp\PrepareBodyMiddleware in /project/lib/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php on line 51


    I can manually use CURL or wget to successfully retrieve: http://127.0.0.1:8086/query?q=SHOW+DATABASES but not from influxdb-php's exists().

    It seems the error related with guzzle 6. Is there any one has similar issue like this?

    opened by saintus 9
  • Point::isValidTimestamp() does not allow nanoseconds

    Point::isValidTimestamp() does not allow nanoseconds

    I may be missing something, but https://github.com/influxdb/influxdb-php/blob/master/src/InfluxDB/Point.php#L160 validates if parameter is INT or fits within PHP_MAX_INT range. This is not sufficient to carry nano-seconds timestamps.

    Why aren't float or double types accepted at face value?

    opened by andig 9
  • New version: 1.0.0

    New version: 1.0.0

    @danibrutal @CentaurWarchief please review version 1.0.0

    • Removed support for php 5.3, php 5.4
    • Upgraded to new guzzle bundle
    • Added UDP support
    • Allow for pluggable drivers
    opened by thecodeassassin 8
  • Make Guzzle dependency optional

    Make Guzzle dependency optional

    Currently guzzlehttp/guzzle:6.* dependency is mandatory to install even if you are going to use UDP transport. This makes the library impossible to use with projects which already use older versions of Guzzle.

    This PR makes the Guzzle dependency optional.

    enhancement 
    opened by tuupola 7
  • Should this package compatible with PHP 5.3?

    Should this package compatible with PHP 5.3?

    Why? PHP 5.3 is not supported anymore since 11 months ago. So why should we? http://php.net/eol.php

    I really think we should move on. We're in the imminence of PHP 7 and at the same time supporting old branches :(.

    opened by andreyvital 7
  • Updating Influx Database with support for writing direct payloads + Minor cleanup

    Updating Influx Database with support for writing direct payloads + Minor cleanup

    • Updating Influx Database with support for writing direct payloads results in over 5x performance increase when writing large Points/Payloads.
    • Corresponding Docblock updates for improved thoroughness.
    • Cleaning up some extra spaces in Point.
    enhancement 
    opened by virgofx 6
  • Paced releases

    Paced releases

    Would it be possible to deploy regular updates in a similar way with influxdb or telegraf. That'd make us become more confident with the library. It's a shame we do not get enough incentives to switch from the wonderful https://github.com/corley/influxdb-php-sdk to this library, which is closer to the core influxdb project.

    opened by skynet 6
  • Bump guzzlehttp/guzzle from 7.2.0 to 7.4.5

    Bump guzzlehttp/guzzle from 7.2.0 to 7.4.5

    Bumps guzzlehttp/guzzle from 7.2.0 to 7.4.5.

    Release notes

    Sourced from guzzlehttp/guzzle's releases.

    Release 7.4.5

    See change log for changes.

    Release 7.4.4

    See change log for changes.

    Release 7.4.3

    See change log for changes.

    Release 7.4.2

    See change log for changes.

    Release 7.4.1

    See change log for changes.

    Release 7.4.0

    See change log for changes.

    Release 7.3.0

    See change log for changes.

    Changelog

    Sourced from guzzlehttp/guzzle's changelog.

    7.4.5 - 2022-06-20

    • Fix change in port should be considered a change in origin
    • Fix CURLOPT_HTTPAUTH option not cleared on change of origin

    7.4.4 - 2022-06-09

    • Fix failure to strip Authorization header on HTTP downgrade
    • Fix failure to strip the Cookie header on change in host or HTTP downgrade

    7.4.3 - 2022-05-25

    • Fix cross-domain cookie leakage

    7.4.2 - 2022-03-20

    Fixed

    • Remove curl auth on cross-domain redirects to align with the Authorization HTTP header
    • Reject non-HTTP schemes in StreamHandler
    • Set a default ssl.peer_name context in StreamHandler to allow force_ip_resolve

    7.4.1 - 2021-12-06

    Changed

    • Replaced implicit URI to string coercion #2946
    • Allow symfony/deprecation-contracts version 3 #2961

    Fixed

    • Only close curl handle if it's done #2950

    7.4.0 - 2021-10-18

    Added

    Fixed

    • Make sure we always call restore_error_handler() #2915
    • Fix progress parameter type compatibility between the cURL and stream handlers #2936
    • Throw InvalidArgumentException when an incorrect headers array is provided #2916, #2942

    Changed

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • [PHP 8.1] Fixed argument type mismatch

    [PHP 8.1] Fixed argument type mismatch

    fixed "Argument #1 ($socket) must be of type resource, bool given".

    whenever a stream could not be created the property was still passed to stream_socket_sendto which causes an type error in php 8.1.

    • fixed #165
    opened by tobias-trozowski 0
  • TypeError with php 8.1

    TypeError with php 8.1

    Hello, since php 8.1 some tests are failing with TypeErrors: image

    stream_socket_sendto(): Argument #1 ($socket) must be of type resource, bool given

        public function write($data = null)
        {
            if (isset($this->stream) === false) {
                $this->createStream();
            }
    
            @stream_socket_sendto($this->stream, $data);
    
            return true;
        }
    

    "influxdb/influxdb-php": "1.15.2",

    opened by webmake 0
  • Isn't 202 a valid status code as well?

    Isn't 202 a valid status code as well?

    I'm getting 202 from my InfluxDB instance. But it throws an exception, probably because of https://github.com/influxdata/influxdb-php/blob/master/src/InfluxDB/Driver/Guzzle.php#L120

    Isn't 202 a valid status code as well?

    opened by leocavalcante 0
  • Incorrect PRECISION_NANOSECONDS marker

    Incorrect PRECISION_NANOSECONDS marker

    In https://github.com/influxdata/influxdb-php/blob/master/src/InfluxDB/Database.php#L35

        const PRECISION_NANOSECONDS = 'n';
    

    Technically this is incorrect as the parameter should be 'ns' not 'n', but since the default is nanoseconds anyway, it's basically just a red herring that does nothing. See https://archive.docs.influxdata.com/influxdb/v1.2/tools/api/#write — The "fix", if any, is to just change precision=n to precision=ns, or drop precision altogether and just assume nanoseconds throughout.

    opened by bendoh 0
Releases(1.15.2)
PHP Unoconv - An Object Oriented library which allow easy to use file conversion with Unoconv.

An Object Oriented library which allow easy to use file conversion with Unoconv. Install The recommended way to install PHP-Unoconv is thr

Alchemy 69 Dec 3, 2022
My solution use PHP with a class for easy setup

My solution use PHP with a class for easy setup. It accepts requests with the get method just passing the username and password as well as the ip and http port of the Proxmox server. Just needing a web server.

Full Monitoring 2 Jan 15, 2022
Laravel package to make it easy to use the gorgeous emojis from EmojiOne

laravel-emojione Laravel package to make it easier working with the gorgeous emojis from EmojiOne. Remember to read the EmojiOne Free License and prov

Christoffer Korvald 140 Nov 29, 2022
An easy-to-use web interface for downloading bittorrents, videos from twitter, youtube and the likes

An easy-to-use web interface for Aria2 and youtube-dl Search for torrents within the app from mutiple BT sites Control Aria2 and manage download tasks

jiaxin huang 54 Dec 22, 2022
Very easy to use a current limiting component, the code is very simple, based on the webman framework.

Very easy to use a current limiting component, the code is very simple, based on the webman framework.

nsp-team 13 Dec 29, 2022
NamelessMC is a free, easy to use & powerful website software for your Minecraft server, which includes a large range of features.

NamelessMC is a free, easy to use & powerful website software for your Minecraft server, which includes a large range of features

NamelessMC 519 Dec 31, 2022
A simple and easy-to-use enumeration extension package to help you manage enumerations in your project more conveniently

A simple and easy-to-use enumeration extension package to help you manage enumerations in your project more conveniently

null 3 Jul 29, 2022
An easy-to-use API for Discord webhook

WebhookAPI An easy-to-use API for Discord webhook İmage: Example Add use use ayd1ndemirci\WebhookAPI; Usage: $webhook = "your_discord_webhook_url";

Aydın Demirci 5 Jun 7, 2023
Code to accompany the YouTube video "Full PHP cURL API tutorial - how to use a REST API from PHP using cURL"

PHP cURL CRUD Example Example code to accompany this YouTube video. Note that the init_curl.php file contains a placeholder for an API key. DO NOT che

Dave Hollingworth 14 Dec 24, 2022
A quick naked theme to demonstrate how easy it is to support Gutenberg using ACF blocks

ACF Gutenberg Demo Theme A quick naked theme to demonstrate how easy it is to support Gutenberg using ACF blocks demo.mp4 Files I have found a useful

Stirtingale 1 Oct 28, 2021
This package provides a set of factories to be used with containers using the PSR-11 standard for an easy Doctrine integration in a project

psr-container-doctrine: Doctrine Factories for PSR-11 Containers Doctrine factories for PSR-11 containers. This package provides a set of factories to

Roave, LLC 84 Dec 14, 2022
A wrapper around symplify/config-transformer used to update recipes and using easy coding standard for generating readable config files.

Symfony Recipes Yaml to PHP Converter This is a wrapper around the symplify/config-transformer used to convert Symfony core recipes which uses .yaml c

Alexander Schranz 3 Nov 24, 2022
MOP is a php query handling and manipulation library providing easy and reliable way to manipulate query and get result in a fastest way

Mysql Optimizer mysql optimizer also known as MOP is a php query handling and manipulation library providing easy and reliable way to manipulate query

null 2 Nov 20, 2021
EasyRdf is a PHP library designed to make it easy to consume and produce RDF.

EasyRdf EasyRdf is a PHP library designed to make it easy to consume and produce RDF. It was designed for use in mixed teams of experienced and inexpe

EasyRdf 578 Dec 23, 2022
Deeper is a easy way to compare if 2 objects is equal based on values in these objects. This library is heavily inspired in Golang's reflect.DeepEqual().

Deeper Deeper is a easy way to compare if 2 objects is equal based on values in these objects. This library is heavily inspired in Golang's reflect.De

Joubert RedRat 4 Feb 12, 2022
Static Web App to train Filipinos in using MS Word with the use of Filipino language

MS Word Filipino Isang static web application na layuning magturo ng paggamit ng MS Word sa wikang Filipino. Ito ay isang proyekto na bahagi ng panana

Jetsun Prince Torres 2 Sep 30, 2022
This example shows how to use Anychart library with the PHP programming language, Laravel framework and MySQL database.

PHP basic template This example shows how to use Anychart library with the PHP programming language, Laravel framework and MySQL database. Running To

AnyChart Integrations and Templates 23 Jul 17, 2022
This repository demonstrates exemplary implementation of chat using HTTP and Websocket servers in PHP using Kraken Framework components.

This repository demonstrates exemplary implementation of chat using HTTP and Websocket servers in PHP using Kraken Framework components.

Kraken 48 Aug 11, 2021
Thin assertion library for use in libraries and business-model

Assert A simple php library which contains assertions and guard methods for input validation (not filtering!) in business-model, libraries and applica

Benjamin Eberlei 2.3k Dec 23, 2022