Skip to content

Commit b2475cb

Browse files
authored
Merge pull request #2 from ge-tracker/client-3.0
Upgrade to influxdb-3.0 client
2 parents 9772fbd + bae5934 commit b2475cb

File tree

4 files changed

+12
-8
lines changed

4 files changed

+12
-8
lines changed

README.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This package is a Laravel wrapper for the [influxdb-php](https://packagist.org/p
44

55
## Installation
66

7-
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).
7+
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).
88

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

@@ -83,11 +83,9 @@ use GeTracker\InfluxDBLaravel\InfluxDBManager;
8383
8484
class Foo
8585
{
86-
/** @var InfluxDBManager */
87-
protected $influxDb;
88-
89-
public function __construct(InfluxDBManager $influxDb)
90-
{
86+
public function __construct(
87+
protected InfluxDBManager $influxDb
88+
) {
9189
$this->influxDB = $influxDB;
9290
}
9391

composer.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@
77
"graham-campbell/manager": "^5.0",
88
"illuminate/contracts": "^8.0|^9.0|^10.0",
99
"illuminate/support": "^8.0|^9.0|^10.0",
10-
"influxdata/influxdb-client-php": "^2.6"
10+
"influxdata/influxdb-client-php": "^3.4"
1111
},
1212
"require-dev": {
13+
"guzzlehttp/guzzle": "^7.0.1",
1314
"orchestra/testbench": "^6.0|^7.0|^8.0"
1415
},
1516
"license": "MIT",
@@ -28,7 +29,10 @@
2829
"prefer-stable": true,
2930
"config": {
3031
"sort-packages": true,
31-
"preferred-install": "dist"
32+
"preferred-install": "dist",
33+
"allow-plugins": {
34+
"php-http/discovery": true
35+
}
3236
},
3337
"extra": {
3438
"laravel": {

config/influxdb.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
'org' => env('INFLUXDB_ORG'),
3434
'verifySSL' => env('INFLUXDB_VERIFY_SSL', false),
3535
'precision' => env('INFLUXDB_PRECISION', 'ns'),
36+
'debug' => env('INFLUXDB_DEBUG', false),
3637
],
3738

3839
],

src/InfluxDBFactory.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ public function make(array $config): Client
2323
'org' => $config['org'],
2424
'verifySSL' => $config['verifySSL'],
2525
'precision' => $config['precision'],
26+
'debug' => $config['debug'] ?? false,
2627
]);
2728
}
2829
}

0 commit comments

Comments
 (0)