Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 20 additions & 26 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@

version: 2.1

orbs:
codecov: codecov/codecov@6.0.0
commands:
influxdb-onboarding:
steps:
Expand Down Expand Up @@ -59,17 +61,7 @@ commands:
command: |
export XDEBUG_MODE=coverage
vendor/bin/phpunit tests --coverage-clover=coverage.xml
- run:
name: Collecting coverage reports
command: |
curl -Os https://uploader.codecov.io/latest/linux/codecov
curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM
curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig
curl -s https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring --keyring trustedkeys.gpg --import
gpgv codecov.SHA256SUM.sig codecov.SHA256SUM
shasum -a 256 -c codecov.SHA256SUM
chmod +x ./codecov
./codecov
- codecov/upload
- save_cache:
name: Saving Cache
key: composer-v3-{{ checksum "composer.json" }}-<< parameters.php-image >>
Expand All @@ -86,13 +78,13 @@ jobs:
parameters:
php-image:
type: string
default: &default-php-image "cimg/php:7.4"
default: &default-php-image "cimg/php:8.0"
influxdb-image:
type: string
default: &default-influxdb-image "influxdb:latest"
xdebug-package:
type: string
default: "xdebug-3.1.6"
default: "xdebug"
docker:
- image: << parameters.php-image >>
- image: &influx-image << parameters.influxdb-image >>
Expand Down Expand Up @@ -136,12 +128,12 @@ jobs:
- storing-test-results
tests-windows:
machine:
image: "windows-server-2019-vs2019:stable"
image: "windows-server-2022-gui:current"
resource_class: windows.medium
shell: bash
steps:
- checkout
- run: choco install php --version=7.3.15 --params '"/ThreadSafe /InstallDir:c:\tools\php"'
- run: choco install php --version=8.0.30 --params '"/ThreadSafe /InstallDir:c:\tools\php"'
- run: cp ~/project/.circleci/php.ini /c/tools/php/
- run: /c/tools/php/php.exe -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
- run: /c/tools/php/php.exe composer-setup.php
Expand All @@ -157,8 +149,8 @@ jobs:
- checkout
- run: |
mkdir -p tools/php-cs-fixer
composer require --working-dir=tools/php-cs-fixer friendsofphp/php-cs-fixer:2.18.7
tools/php-cs-fixer/vendor/bin/php-cs-fixer fix --dry-run --verbose --show-progress=estimating --using-cache=no --diff
composer require --working-dir=tools/php-cs-fixer friendsofphp/php-cs-fixer:3.95.13
tools/php-cs-fixer/vendor/bin/php-cs-fixer fix --dry-run --verbose --show-progress=dots --using-cache=no --diff

workflows:
version: 2
Expand All @@ -167,27 +159,29 @@ workflows:
not:
equal: [ scheduled_pipeline, << pipeline.trigger_source >> ]
jobs:
- tests-php:
name: php-7.4
- tests-php:
name: php-8.0
php-image: "cimg/php:8.0"
xdebug-package: "xdebug-3.1.6"
- tests-php:
name: php-8.1
php-image: "cimg/php:8.1"
xdebug-package: "xdebug-3.1.6"
- tests-php:
name: php-8.2
php-image: "cimg/php:8.2"
xdebug-package: "xdebug"
- tests-php:
name: php-7.4-nightly
influxdb-image: "quay.io/influxdb/influxdb:nightly"
name: php-8.3
php-image: "cimg/php:8.3"
- tests-php:
name: php-8.4
php-image: "cimg/php:8.4"
- tests-php:
name: php-7.3
php-image: "cimg/php:7.3"
name: php-8.5
php-image: "cimg/php:8.5"
- tests-php:
name: php-7.2
php-image: "cimg/php:7.2"
name: php-8.5-nightly
influxdb-image: "quay.io/influxdb/influxdb:nightly"
- tests-windows:
name: php-windows
- tests-cURL:
Expand Down
6 changes: 3 additions & 3 deletions .circleci/php.ini
Original file line number Diff line number Diff line change
Expand Up @@ -934,7 +934,7 @@ extension=openssl
;extension=snmp

;extension=soap
;extension=sockets
extension=sockets
;extension=sodium
;extension=sqlite3
;extension=tidy
Expand Down Expand Up @@ -1708,7 +1708,7 @@ zend.assertions = 1
;mbstring.http_output_conv_mimetype=

; This directive specifies maximum stack depth for mbstring regular expressions. It is similar
; to the pcre.recursion_limit for PCRE.
; to the pcre.recursion_limit for PCRE.
; Default: 100000
;mbstring.regex_stack_limit=100000

Expand Down Expand Up @@ -1934,4 +1934,4 @@ ldap.max_links = -1

; Local Variables:
; tab-width: 4
; End:
; End:
4 changes: 2 additions & 2 deletions .php_cs.dist → .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
return PhpCsFixer\Config::create()
return (new PhpCsFixer\Config())
->setFinder(
PhpCsFixer\Finder::create()
->exclude('src/InfluxDB2/Model')
Expand All @@ -8,4 +8,4 @@
->notPath('src/InfluxDB2/ObjectSerializer.php')
->in(__DIR__)
)
;
;
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## 3.9.0 [unreleased]

1. [#170](https://github.com/influxdata/influxdb-client-php/pull/170): Fix PHP 8.5 deprecations. PHP minimum version is PHP 8.0.

## 3.8.0 [2026-06-26]

### Bug Fixes
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM php:7.2-cli AS dev
FROM php:8.5-cli AS dev

COPY --from=composer /usr/bin/composer /usr/bin/

RUN yes | pecl install xdebug-2.9.8 \
RUN yes | pecl install xdebug \
&& echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.remote_enable=on" >> /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.remote_autostart=on" >> /usr/local/etc/php/conf.d/xdebug.ini
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@
"homepage": "https://www.github.com/influxdata/influxdb-client-php",
"license": "MIT",
"require": {
"php": ">=7.2",
"php": ">=8.0",
"ext-curl": "*",
"ext-json": "*",
"ext-mbstring": "*",
"ext-sockets": "*",
"php-http/client-common": "^2.2.1",
"php-http/discovery": "^1.9.1",
"psr/http-client": "^1.0.1"
Expand Down
1 change: 1 addition & 0 deletions examples/BucketManagementExample.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Shows how to create, list and delete Buckets
*/
Expand Down
1 change: 1 addition & 0 deletions examples/DeleteDataExample.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Shows how to delete data from InfluxDB by client
*/
Expand Down
1 change: 1 addition & 0 deletions examples/InfluxDB_18_Example.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Shows how to use forward compatibility APIs from InfluxDB 1.8.
*/
Expand Down
1 change: 1 addition & 0 deletions examples/InvokableScripts.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Show to use Invokable scripts Cloud API to create custom endpoints that query data
*
Expand Down
1 change: 1 addition & 0 deletions examples/ParameterizedQuery.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Shows how to use parameterized queries
*/
Expand Down
1 change: 1 addition & 0 deletions examples/WriteBatchingExample.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Shows how to use batching for more performance writes.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/InfluxDB2/ApiException.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* ApiException
* PHP version 5
Expand Down Expand Up @@ -41,7 +42,6 @@
*/
class ApiException extends RuntimeException
{

/**
* The HTTP body of the server response either as Json or string.
*
Expand Down
2 changes: 1 addition & 1 deletion src/InfluxDB2/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Client
/**
* Client version updated by: 'make release VERSION=1.5.0'
*/
const VERSION = 'dev';
public const VERSION = 'dev';

public $options;
public $closed = false;
Expand Down
1 change: 1 addition & 0 deletions src/InfluxDB2/Configuration.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Configuration
* PHP version 5
Expand Down
2 changes: 1 addition & 1 deletion src/InfluxDB2/FluxCsvParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ private function toValue($strVal, FluxColumn $column)
if ($strVal == '-Inf') {
return -INF;
}
return (double)$strVal;
return (float)$strVal;
}

if ('base64Binary' == $column->dataType) {
Expand Down
1 change: 0 additions & 1 deletion src/InfluxDB2/FluxCsvParserException.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


namespace InfluxDB2;

class FluxCsvParserException extends \RuntimeException
Expand Down
1 change: 0 additions & 1 deletion src/InfluxDB2/FluxRecord.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


namespace InfluxDB2;

use ArrayAccess;
Expand Down
2 changes: 2 additions & 0 deletions src/InfluxDB2/FluxTable.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

# The MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
Expand All @@ -18,6 +19,7 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

namespace InfluxDB2;

/**
Expand Down
1 change: 0 additions & 1 deletion src/InfluxDB2/PointSettings.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


namespace InfluxDB2;

class PointSettings
Expand Down
1 change: 0 additions & 1 deletion src/InfluxDB2/UdpWriter.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


namespace InfluxDB2;

/**
Expand Down
2 changes: 1 addition & 1 deletion src/InfluxDB2/Worker.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ private function checkBackgroundQueue(bool $size)

if ($index === null) {
$data[] = array('key' => $key, 'data' => array());
$index = array_keys($data)[count($data)-1];
$index = array_keys($data)[count($data) - 1];
}

$data[$index]['data'][] = $item->data;
Expand Down
14 changes: 7 additions & 7 deletions src/InfluxDB2/WriteOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

class WriteOptions
{
const DEFAULT_BATCH_SIZE = 10;
const DEFAULT_RETRY_INTERVAL = 5000;
const DEFAULT_MAX_RETRIES = 5;
const DEFAULT_MAX_RETRY_DELAY = 125000;
const DEFAULT_MAX_RETRY_TIME = 180000;
const DEFAULT_EXPONENTIAL_BASE = 2;
const DEFAULT_JITTER_INTERVAL = 0;
public const DEFAULT_BATCH_SIZE = 10;
public const DEFAULT_RETRY_INTERVAL = 5000;
public const DEFAULT_MAX_RETRIES = 5;
public const DEFAULT_MAX_RETRY_DELAY = 125000;
public const DEFAULT_MAX_RETRY_TIME = 180000;
public const DEFAULT_EXPONENTIAL_BASE = 2;
public const DEFAULT_JITTER_INTERVAL = 0;

public $writeType;
public $batchSize;
Expand Down
1 change: 0 additions & 1 deletion src/InfluxDB2/WritePayloadSerializer.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


namespace InfluxDB2;

class WritePayloadSerializer
Expand Down
4 changes: 2 additions & 2 deletions src/InfluxDB2/WriteType.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@

class WriteType
{
const SYNCHRONOUS = 1;
const BATCHING = 2;
public const SYNCHRONOUS = 1;
public const BATCHING = 2;
}
2 changes: 0 additions & 2 deletions src/InfluxDB2/Writer.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
<?php


namespace InfluxDB2;

interface Writer
{

/**
* Write data
*
Expand Down
1 change: 0 additions & 1 deletion tests/ClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use Exception;
use InfluxDB2\Client;
use IntegrationBaseTestCase;

require_once('IntegrationBaseTestCase.php');

Expand Down
4 changes: 3 additions & 1 deletion tests/DefaultApiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@ private function property_value(object $object, string $property_name): object
{
$reflection = new ReflectionObject($object);
$property = $reflection->getProperty($property_name);
$property->setAccessible(true);
if (PHP_VERSION_ID < 80100) {
$property->setAccessible(true);
}
return $property->getValue($object);
}
}
2 changes: 1 addition & 1 deletion tests/FluxCsvParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ private function assertMultipleRecords(array $tables)
private function assertRecord(FluxRecord $fluxRecord, array $values, $size = 0, $value = null)
{
foreach ($values as $key => $val) {
$this->assertEquals($values[$key], $fluxRecord->values[$key]);
$this->assertEquals($val, $fluxRecord->values[$key]);
}

if ($value == null) {
Expand Down
2 changes: 2 additions & 0 deletions tests/ITBucketServiceTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

namespace InfluxDB2Test;

use InfluxDB2\ApiException;
use InfluxDB2\Model\BucketRetentionRules;
use InfluxDB2\Model\PostBucketRequest;
Expand Down
2 changes: 2 additions & 0 deletions tests/ITTaskServiceTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

namespace InfluxDB2Test;

use InfluxDB2\Model\TaskCreateRequest;
use InfluxDB2\Service\TasksService;

Expand Down
Loading
Loading