Releases: corley/influxdb-php-sdk
First stable realease - 1.0.0
After almost 3 years (first commit by @gianarb on Sep 10, 2014) we finally decided to tag this version as our first stable branch 1.0.0 in order to keep stable our project.
In this release we just seal the base implementation and interfaces.
This project is now tested with the latest InfluxDB 1.2.4
branch
Breaking changes
- Drop Guzzle 4 support (in favor of PHP 7.1)
Implemented new escapes for: comma, equal sign and spaces
Fixes minor casing issue
Fixes minor casing issue
Fixes minor casing issue on namespace import
- PR #66
Minor updates
Just removed Zend Framework library support that is not used anymore in v0.9 as v0.8 and fixes the PHPUnit configuration file with a more clear and usable testsuite configuration
./vendor/bin/phpunit --testsuite unit
./vendor/bin/phpunit --testsuite integration
InfluxDB Manager
In order to supports different database related queries like:
- create database
- list database
- delete database
- and so on...
We should have to fill the base client InfluxDB\Client
with several methods:
public function createDatabase($name) { /* ... */ }
public function deleteDatabase($name) { /* ... */ }
public function getDatabases() { /* ... */ }
public function createRetentionPolicy($name) { /* ... */ }
// ...
As many as InfluxDB prepared queries. Instead of that we drop the database management query from the InfluxDB\Client
and add a new layer: InfluxDB\Manager
that will support InfluxDB prepared queries.
The manager
$manager = new Manager($client);
The manager accepts any query via callables:
$manager->addQuery("queryName", function($arg1, $arg2) {
return sprintf("THIS IS MY QUERY WITH: {$arg1} and {$arg2}");
});
// late in your code:
$manager->queryName(1, 2); // THIS IS MY QUERY WITH: 1 and 2
In order to create and share different database management query, objects can used:
class MyCustomQuery
{
public function __invoke($arg1, $arg2)
{
return sprintf("THIS IS MY QUERY WITH: {$arg1} and {$arg2}");
}
public function __toString()
{
return "myCustomQuery";
}
}
// add it
$manager->addQuery(new MyCustomQuery());
// use it
$manager->myCustomQuery(1, 2);
Less dependencies
Just removed Zend Framework library support that is not used anymore in v0.8
Deprecate database management methods
In order to create a better support for database management e custom query support, we deprecate methods:
getDatabases
createDatabase
deleteDatabase
and we will remove those methods in v0.9.0
and we will introduce a manager in order to support those features
$manager->addQuery("getExceptionsInMinutes", function($minutes) {
return "SELECT * FROM errors WHERE time > now() - {$minutes}m";
});
//late in your code...
$data = $manager->getExceptionsInMinutes(10);
Moved to readers and writers
With the 0.7.* version of this library we cannot read and write data using different network adapters. In particular write using UDP/IP and read data back with HTTP. For that reason we move the library removing network adapters and move the project to readers
and writers
With this approach you can combine different techniques for reads and writes.
$reader = new Http\Reader($http, $httpOptions);
$writer = new Udp\Writer($udpOptions);
$client = new Client($reader, $writer);
$client->mark(...); // Use UDP/IP support
$client->query("SELECT * FROM my_serie"); // Use HTTP support
BC BREAK
- Client constructor (Readers and Writers)