Skip to content

Commit

Permalink
Merge pull request #2 from ge-tracker/client-3.0
Browse files Browse the repository at this point in the history
Upgrade to influxdb-3.0 client
  • Loading branch information
gtjamesa authored Jan 19, 2024
2 parents 9772fbd + bae5934 commit b2475cb
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This package is a Laravel wrapper for the [influxdb-php](https://packagist.org/p

## Installation

This package requires PHP 7.4+, Laravel 8+ and works with InfluxDB 2.0. For InfluxDB 1.x, see the [1.x setup instructions in the next section](#influxdb-1x).
This package requires PHP 7.4+, Laravel 8+ and works with InfluxDB 2.0/1.8+. For InfluxDB 1.7 or earlier, see the [1.x setup instructions in the next section](#influxdb-1x).

1. To install the latest version of the package, run the following command in your terminal:

Expand Down Expand Up @@ -83,11 +83,9 @@ use GeTracker\InfluxDBLaravel\InfluxDBManager;
class Foo
{
/** @var InfluxDBManager */
protected $influxDb;
public function __construct(InfluxDBManager $influxDb)
{
public function __construct(
protected InfluxDBManager $influxDb
) {
$this->influxDB = $influxDB;
}
Expand Down
8 changes: 6 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
"graham-campbell/manager": "^5.0",
"illuminate/contracts": "^8.0|^9.0|^10.0",
"illuminate/support": "^8.0|^9.0|^10.0",
"influxdata/influxdb-client-php": "^2.6"
"influxdata/influxdb-client-php": "^3.4"
},
"require-dev": {
"guzzlehttp/guzzle": "^7.0.1",
"orchestra/testbench": "^6.0|^7.0|^8.0"
},
"license": "MIT",
Expand All @@ -28,7 +29,10 @@
"prefer-stable": true,
"config": {
"sort-packages": true,
"preferred-install": "dist"
"preferred-install": "dist",
"allow-plugins": {
"php-http/discovery": true
}
},
"extra": {
"laravel": {
Expand Down
1 change: 1 addition & 0 deletions config/influxdb.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
'org' => env('INFLUXDB_ORG'),
'verifySSL' => env('INFLUXDB_VERIFY_SSL', false),
'precision' => env('INFLUXDB_PRECISION', 'ns'),
'debug' => env('INFLUXDB_DEBUG', false),
],

],
Expand Down
1 change: 1 addition & 0 deletions src/InfluxDBFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public function make(array $config): Client
'org' => $config['org'],
'verifySSL' => $config['verifySSL'],
'precision' => $config['precision'],
'debug' => $config['debug'] ?? false,
]);
}
}

0 comments on commit b2475cb

Please sign in to comment.