diff --git a/composer.json b/composer.json index 8bd5350b62..7a8a520e61 100644 --- a/composer.json +++ b/composer.json @@ -1,11 +1,10 @@ { "require": { - "abbadon1334/sun-position-spa-php" : "^2", + "abbadon1334/sun-position-spa-php": "^2", "dragonmantank/cron-expression": "^3", "symfony/expression-language": "5 - 7", "pragmarx/google2fa-qrcode": "^3", "bacon/bacon-qr-code": "2 - 3", - "influxdata/influxdb-client-php": "^3", "psr/log": "^1.1", "php": ">=7.4" }, diff --git a/composer.lock b/composer.lock index 96e13482b3..2293946d64 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "6f406f5b318ce2f2efbbed9597706668", + "content-hash": "e58958ecfd08425a9af4481786a65d4d", "packages": [ { "name": "abbadon1334/sun-position-spa-php", @@ -111,72 +111,6 @@ }, "time": "2022-12-07T17:46:57+00:00" }, - { - "name": "clue/stream-filter", - "version": "v1.7.0", - "source": { - "type": "git", - "url": "https://github.com/clue/stream-filter.git", - "reference": "049509fef80032cb3f051595029ab75b49a3c2f7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/clue/stream-filter/zipball/049509fef80032cb3f051595029ab75b49a3c2f7", - "reference": "049509fef80032cb3f051595029ab75b49a3c2f7", - "shasum": "" - }, - "require": { - "php": ">=5.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" - }, - "type": "library", - "autoload": { - "files": [ - "src/functions_include.php" - ], - "psr-4": { - "Clue\\StreamFilter\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Christian Lück", - "email": "christian@clue.engineering" - } - ], - "description": "A simple and modern approach to stream filtering in PHP", - "homepage": "https://github.com/clue/stream-filter", - "keywords": [ - "bucket brigade", - "callback", - "filter", - "php_user_filter", - "stream", - "stream_filter_append", - "stream_filter_register" - ], - "support": { - "issues": "https://github.com/clue/stream-filter/issues", - "source": "https://github.com/clue/stream-filter/tree/v1.7.0" - }, - "funding": [ - { - "url": "https://clue.engineering/support", - "type": "custom" - }, - { - "url": "https://github.com/clue", - "type": "github" - } - ], - "time": "2023-12-20T15:40:13+00:00" - }, { "name": "dasprid/enum", "version": "1.0.7", @@ -291,56 +225,6 @@ ], "time": "2025-10-31T18:36:32+00:00" }, - { - "name": "influxdata/influxdb-client-php", - "version": "3.8.0", - "source": { - "type": "git", - "url": "https://github.com/influxdata/influxdb-client-php.git", - "reference": "59ac11d63ce030973c79d5b05797813761a0d58e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/influxdata/influxdb-client-php/zipball/59ac11d63ce030973c79d5b05797813761a0d58e", - "reference": "59ac11d63ce030973c79d5b05797813761a0d58e", - "shasum": "" - }, - "require": { - "ext-curl": "*", - "ext-json": "*", - "ext-mbstring": "*", - "php": ">=7.2", - "php-http/client-common": "^2.2.1", - "php-http/discovery": "^1.9.1", - "psr/http-client": "^1.0.1" - }, - "require-dev": { - "guzzlehttp/guzzle": "^7.0.1", - "guzzlehttp/psr7": "^2.0.0", - "phpunit/phpunit": "^8.5.27", - "squizlabs/php_codesniffer": "~3.7" - }, - "type": "library", - "autoload": { - "psr-4": { - "InfluxDB2\\": "src/InfluxDB2" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "InfluxDB (v2+) Client Library for PHP", - "homepage": "https://www.github.com/influxdata/influxdb-client-php", - "keywords": [ - "influxdb" - ], - "support": { - "issues": "https://github.com/influxdata/influxdb-client-php/issues", - "source": "https://github.com/influxdata/influxdb-client-php/tree/3.8.0" - }, - "time": "2025-06-26T05:12:59+00:00" - }, { "name": "paragonie/constant_time_encoding", "version": "v2.8.2", @@ -408,332 +292,6 @@ }, "time": "2025-09-24T15:12:37+00:00" }, - { - "name": "php-http/client-common", - "version": "2.7.2", - "source": { - "type": "git", - "url": "https://github.com/php-http/client-common.git", - "reference": "0cfe9858ab9d3b213041b947c881d5b19ceeca46" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-http/client-common/zipball/0cfe9858ab9d3b213041b947c881d5b19ceeca46", - "reference": "0cfe9858ab9d3b213041b947c881d5b19ceeca46", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0", - "php-http/httplug": "^2.0", - "php-http/message": "^1.6", - "psr/http-client": "^1.0", - "psr/http-factory": "^1.0", - "psr/http-message": "^1.0 || ^2.0", - "symfony/options-resolver": "~4.0.15 || ~4.1.9 || ^4.2.1 || ^5.0 || ^6.0 || ^7.0", - "symfony/polyfill-php80": "^1.17" - }, - "require-dev": { - "doctrine/instantiator": "^1.1", - "guzzlehttp/psr7": "^1.4", - "nyholm/psr7": "^1.2", - "phpspec/phpspec": "^5.1 || ^6.3 || ^7.1", - "phpspec/prophecy": "^1.10.2", - "phpunit/phpunit": "^7.5.20 || ^8.5.33 || ^9.6.7" - }, - "suggest": { - "ext-json": "To detect JSON responses with the ContentTypePlugin", - "ext-libxml": "To detect XML responses with the ContentTypePlugin", - "php-http/cache-plugin": "PSR-6 Cache plugin", - "php-http/logger-plugin": "PSR-3 Logger plugin", - "php-http/stopwatch-plugin": "Symfony Stopwatch plugin" - }, - "type": "library", - "autoload": { - "psr-4": { - "Http\\Client\\Common\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" - } - ], - "description": "Common HTTP Client implementations and tools for HTTPlug", - "homepage": "http://httplug.io", - "keywords": [ - "client", - "common", - "http", - "httplug" - ], - "support": { - "issues": "https://github.com/php-http/client-common/issues", - "source": "https://github.com/php-http/client-common/tree/2.7.2" - }, - "time": "2024-09-24T06:21:48+00:00" - }, - { - "name": "php-http/discovery", - "version": "1.20.0", - "source": { - "type": "git", - "url": "https://github.com/php-http/discovery.git", - "reference": "82fe4c73ef3363caed49ff8dd1539ba06044910d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-http/discovery/zipball/82fe4c73ef3363caed49ff8dd1539ba06044910d", - "reference": "82fe4c73ef3363caed49ff8dd1539ba06044910d", - "shasum": "" - }, - "require": { - "composer-plugin-api": "^1.0|^2.0", - "php": "^7.1 || ^8.0" - }, - "conflict": { - "nyholm/psr7": "<1.0", - "zendframework/zend-diactoros": "*" - }, - "provide": { - "php-http/async-client-implementation": "*", - "php-http/client-implementation": "*", - "psr/http-client-implementation": "*", - "psr/http-factory-implementation": "*", - "psr/http-message-implementation": "*" - }, - "require-dev": { - "composer/composer": "^1.0.2|^2.0", - "graham-campbell/phpspec-skip-example-extension": "^5.0", - "php-http/httplug": "^1.0 || ^2.0", - "php-http/message-factory": "^1.0", - "phpspec/phpspec": "^5.1 || ^6.1 || ^7.3", - "sebastian/comparator": "^3.0.5 || ^4.0.8", - "symfony/phpunit-bridge": "^6.4.4 || ^7.0.1" - }, - "type": "composer-plugin", - "extra": { - "class": "Http\\Discovery\\Composer\\Plugin", - "plugin-optional": true - }, - "autoload": { - "psr-4": { - "Http\\Discovery\\": "src/" - }, - "exclude-from-classmap": [ - "src/Composer/Plugin.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" - } - ], - "description": "Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations", - "homepage": "http://php-http.org", - "keywords": [ - "adapter", - "client", - "discovery", - "factory", - "http", - "message", - "psr17", - "psr7" - ], - "support": { - "issues": "https://github.com/php-http/discovery/issues", - "source": "https://github.com/php-http/discovery/tree/1.20.0" - }, - "time": "2024-10-02T11:20:13+00:00" - }, - { - "name": "php-http/httplug", - "version": "2.4.1", - "source": { - "type": "git", - "url": "https://github.com/php-http/httplug.git", - "reference": "5cad731844891a4c282f3f3e1b582c46839d22f4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-http/httplug/zipball/5cad731844891a4c282f3f3e1b582c46839d22f4", - "reference": "5cad731844891a4c282f3f3e1b582c46839d22f4", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0", - "php-http/promise": "^1.1", - "psr/http-client": "^1.0", - "psr/http-message": "^1.0 || ^2.0" - }, - "require-dev": { - "friends-of-phpspec/phpspec-code-coverage": "^4.1 || ^5.0 || ^6.0", - "phpspec/phpspec": "^5.1 || ^6.0 || ^7.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Http\\Client\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Eric GELOEN", - "email": "geloen.eric@gmail.com" - }, - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com", - "homepage": "https://sagikazarmark.hu" - } - ], - "description": "HTTPlug, the HTTP client abstraction for PHP", - "homepage": "http://httplug.io", - "keywords": [ - "client", - "http" - ], - "support": { - "issues": "https://github.com/php-http/httplug/issues", - "source": "https://github.com/php-http/httplug/tree/2.4.1" - }, - "time": "2024-09-23T11:39:58+00:00" - }, - { - "name": "php-http/message", - "version": "1.16.2", - "source": { - "type": "git", - "url": "https://github.com/php-http/message.git", - "reference": "06dd5e8562f84e641bf929bfe699ee0f5ce8080a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-http/message/zipball/06dd5e8562f84e641bf929bfe699ee0f5ce8080a", - "reference": "06dd5e8562f84e641bf929bfe699ee0f5ce8080a", - "shasum": "" - }, - "require": { - "clue/stream-filter": "^1.5", - "php": "^7.2 || ^8.0", - "psr/http-message": "^1.1 || ^2.0" - }, - "provide": { - "php-http/message-factory-implementation": "1.0" - }, - "require-dev": { - "ergebnis/composer-normalize": "^2.6", - "ext-zlib": "*", - "guzzlehttp/psr7": "^1.0 || ^2.0", - "laminas/laminas-diactoros": "^2.0 || ^3.0", - "php-http/message-factory": "^1.0.2", - "phpspec/phpspec": "^5.1 || ^6.3 || ^7.1", - "slim/slim": "^3.0" - }, - "suggest": { - "ext-zlib": "Used with compressor/decompressor streams", - "guzzlehttp/psr7": "Used with Guzzle PSR-7 Factories", - "laminas/laminas-diactoros": "Used with Diactoros Factories", - "slim/slim": "Used with Slim Framework PSR-7 implementation" - }, - "type": "library", - "autoload": { - "files": [ - "src/filters.php" - ], - "psr-4": { - "Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" - } - ], - "description": "HTTP Message related tools", - "homepage": "http://php-http.org", - "keywords": [ - "http", - "message", - "psr-7" - ], - "support": { - "issues": "https://github.com/php-http/message/issues", - "source": "https://github.com/php-http/message/tree/1.16.2" - }, - "time": "2024-10-02T11:34:13+00:00" - }, - { - "name": "php-http/promise", - "version": "1.3.1", - "source": { - "type": "git", - "url": "https://github.com/php-http/promise.git", - "reference": "fc85b1fba37c169a69a07ef0d5a8075770cc1f83" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-http/promise/zipball/fc85b1fba37c169a69a07ef0d5a8075770cc1f83", - "reference": "fc85b1fba37c169a69a07ef0d5a8075770cc1f83", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "friends-of-phpspec/phpspec-code-coverage": "^4.3.2 || ^6.3", - "phpspec/phpspec": "^5.1.2 || ^6.2 || ^7.4" - }, - "type": "library", - "autoload": { - "psr-4": { - "Http\\Promise\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Joel Wurtz", - "email": "joel.wurtz@gmail.com" - }, - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" - } - ], - "description": "Promise used for asynchronous HTTP requests", - "homepage": "http://httplug.io", - "keywords": [ - "promise" - ], - "support": { - "issues": "https://github.com/php-http/promise/issues", - "source": "https://github.com/php-http/promise/tree/1.3.1" - }, - "time": "2024-03-15T13:55:21+00:00" - }, { "name": "pragmarx/google2fa", "version": "v8.0.3", @@ -950,166 +508,6 @@ }, "time": "2021-11-05T16:50:12+00:00" }, - { - "name": "psr/http-client", - "version": "1.0.3", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-client.git", - "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90", - "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90", - "shasum": "" - }, - "require": { - "php": "^7.0 || ^8.0", - "psr/http-message": "^1.0 || ^2.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Client\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP clients", - "homepage": "https://github.com/php-fig/http-client", - "keywords": [ - "http", - "http-client", - "psr", - "psr-18" - ], - "support": { - "source": "https://github.com/php-fig/http-client" - }, - "time": "2023-09-23T14:17:50+00:00" - }, - { - "name": "psr/http-factory", - "version": "1.1.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-factory.git", - "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a", - "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a", - "shasum": "" - }, - "require": { - "php": ">=7.1", - "psr/http-message": "^1.0 || ^2.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "PSR-17: Common interfaces for PSR-7 HTTP message factories", - "keywords": [ - "factory", - "http", - "message", - "psr", - "psr-17", - "psr-7", - "request", - "response" - ], - "support": { - "source": "https://github.com/php-fig/http-factory" - }, - "time": "2024-04-15T12:06:14+00:00" - }, - { - "name": "psr/http-message", - "version": "2.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-message.git", - "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71", - "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP messages", - "homepage": "https://github.com/php-fig/http-message", - "keywords": [ - "http", - "http-message", - "psr", - "psr-7", - "request", - "response" - ], - "support": { - "source": "https://github.com/php-fig/http-message/tree/2.0" - }, - "time": "2023-04-04T09:54:51+00:00" - }, { "name": "psr/log", "version": "1.1.4", @@ -1466,78 +864,9 @@ ], "time": "2024-10-04T14:55:40+00:00" }, - { - "name": "symfony/options-resolver", - "version": "v5.4.45", - "source": { - "type": "git", - "url": "https://github.com/symfony/options-resolver.git", - "reference": "74e5b6f0db3e8589e6cfd5efb317a1fc2bb52fb6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/74e5b6f0db3e8589e6cfd5efb317a1fc2bb52fb6", - "reference": "74e5b6f0db3e8589e6cfd5efb317a1fc2bb52fb6", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-php73": "~1.0", - "symfony/polyfill-php80": "^1.16" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\OptionsResolver\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides an improved replacement for the array_replace PHP function", - "homepage": "https://symfony.com", - "keywords": [ - "config", - "configuration", - "options" - ], - "support": { - "source": "https://github.com/symfony/options-resolver/tree/v5.4.45" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-09-25T14:11:13+00:00" - }, { "name": "symfony/polyfill-php73", - "version": "v1.33.0", + "version": "v1.37.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", @@ -1593,7 +922,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.33.0" + "source": "https://github.com/symfony/polyfill-php73/tree/v1.37.0" }, "funding": [ { @@ -1617,16 +946,16 @@ }, { "name": "symfony/polyfill-php80", - "version": "v1.33.0", + "version": "v1.37.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608" + "reference": "dfb55726c3a76ea3b6459fcfda1ec2d80a682411" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/0cc9dd0f17f61d8131e7df6b84bd344899fe2608", - "reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/dfb55726c3a76ea3b6459fcfda1ec2d80a682411", + "reference": "dfb55726c3a76ea3b6459fcfda1ec2d80a682411", "shasum": "" }, "require": { @@ -1677,7 +1006,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.33.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.37.0" }, "funding": [ { @@ -1697,7 +1026,7 @@ "type": "tidelift" } ], - "time": "2025-01-02T08:10:11+00:00" + "time": "2026-04-10T16:19:22+00:00" }, { "name": "symfony/service-contracts", @@ -1859,11 +1188,11 @@ "packages-dev": [ { "name": "phpstan/phpstan", - "version": "2.1.48", + "version": "2.1.54", "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/231397213efb7c0a066ee024b5c3c87f2d3adfa0", - "reference": "231397213efb7c0a066ee024b5c3c87f2d3adfa0", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/8be50c3992107dc837b17da4d140fbbdf9a5c5bd", + "reference": "8be50c3992107dc837b17da4d140fbbdf9a5c5bd", "shasum": "" }, "require": { @@ -1908,20 +1237,20 @@ "type": "github" } ], - "time": "2026-04-15T20:24:19+00:00" + "time": "2026-04-29T13:31:09+00:00" } ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": {}, "prefer-stable": false, "prefer-lowest": false, "platform": { "php": ">=7.4" }, - "platform-dev": [], + "platform-dev": {}, "platform-overrides": { "php": "7.4" }, - "plugin-api-version": "2.6.0" + "plugin-api-version": "2.9.0" } diff --git a/core/ajax/cmd.ajax.php b/core/ajax/cmd.ajax.php index 728fff5dce..afcb3ec14d 100644 --- a/core/ajax/cmd.ajax.php +++ b/core/ajax/cmd.ajax.php @@ -205,44 +205,6 @@ ajax::success($return); } - if (init('action') == 'dropInflux') { - if (!isConnect('admin')) { - throw new Exception(__('401 - Accès non autorisé', __FILE__)); - } - $cmd = cmd::byId(init('cmd_id')); - if (!is_object($cmd)) { - throw new Exception(__('Commande inconnue :', __FILE__) . ' ' . init('id'), 9999); - } - ajax::success($cmd->dropInflux()); - } - - if (init('action') == 'historyInflux') { - if (!isConnect('admin')) { - throw new Exception(__('401 - Accès non autorisé', __FILE__)); - } - $cmd = cmd::byId(init('cmd_id')); - if (!is_object($cmd)) { - throw new Exception(__('Commande inconnue :', __FILE__) . ' ' . init('id'), 9999); - } - cmd::historyInflux($cmd->getId()); - ajax::success(); - } - - if (init('action') == 'dropDatabaseInflux') { - if (!isConnect('admin')) { - throw new Exception(__('401 - Accès non autorisé', __FILE__)); - } - ajax::success(cmd::dropInfluxDatabase()); - } - - if (init('action') == 'historyInfluxAll') { - if (!isConnect('admin')) { - throw new Exception(__('401 - Accès non autorisé', __FILE__)); - } - cmd::historyInflux('all'); - ajax::success(); - } - if (init('action') == 'getHumanCmdName') { ajax::success(cmd::cmdToHumanReadable('#' . init('id') . '#')); } diff --git a/core/class/cmd.class.php b/core/class/cmd.class.php index 7c07b159c9..eb525b2e85 100644 --- a/core/class/cmd.class.php +++ b/core/class/cmd.class.php @@ -1968,7 +1968,6 @@ public function event($_value, $_datetime = null, $_loop = 1) { $timeline->save(); } $this->pushUrl($value); - $this->pushInflux($value); if ($this->getGeneric_type() == 'BATTERY' && $this->getUnite() == '%') { $this->getEqLogic()->batteryStatus($value); } @@ -2217,209 +2216,6 @@ public function pushUrl($_value) { } } - public function computeInfluxData($_value, $_timestamp = '') { - $point = ''; - try { - $cmdname = $this->getHumanName(); - $name = $this->getName(); - $eqLogic = $this->getEqLogic(); - $eqLogicName = $eqLogic->getName(); - $object = $eqLogic->getObject()->getName(); - $plugin = $eqLogic->getEqType_name(); - if ($this->getConfiguration('influx::namecmd', '') != '') { - $name = $this->getConfiguration('influx::namecmd'); - } - if ($this->getConfiguration('influx::nameEq', '') != '') { - $eqLogicName = $this->getConfiguration('influx::nameEq'); - } - $valName = $this->getConfiguration('influx::nameVal', ''); - $cleanName = str_replace(',', '\,', str_replace(' ', '\ ', $name)); - $genericType = $this->getGeneric_type(); - $genericName = 'Aucun'; - if ($genericType != '') { - $genericName = jeedom::getConfiguration('cmd::generic_type')[$this->getGeneric_type()]['name']; - } - $subtype = $this->getSubType(); - if ($subtype == 'numeric') { - $value = floatval($_value); - } else if ($subtype == 'binary') { - $value = intval($_value); - } else { - $value = $_value; - } - $tagArray = array( - 'box' => config::byKey('name', 'core'), - 'location' => $object, - 'equipement' => $eqLogicName, - 'plugin' => $plugin, - 'cmd' => $cmdname, - 'cmdId' => $this->getId(), - 'cmdname' => $this->getName(), - 'genericType' => $genericName - ); - $valueArray = []; - if ($valName != '') { - $valueArray[$valName] = $value; - $value = null; - } - if ($_timestamp == '') { - $point = new InfluxDB\Point($cleanName, $value, $tagArray, $valueArray); - } else { - $point = new InfluxDB\Point($cleanName, $value, $tagArray, $valueArray, $_timestamp); - } - log::add('cmd', 'debug', 'Push influx for ' . $this->getHumanName() . ' : ' . json_encode($tagArray, true)); - } catch (Exception $e) { - log::add('cmd', 'error', __('Erreur computing influx sur :', __FILE__) . ' ' . ' commande : ' . $this->getHumanName() . ' => ' . log::exception($e)); - } - return $point; - } - - public static function getInflux($_cmdId = null) { - try { - if ($_cmdId) { - $cmd = cmd::byId($_cmdId); - $enabled = $cmd->getConfiguration('influx::enable'); - if (!$enabled) { - return; - } - } - $url = config::byKey('cmdInfluxURL'); - $port = config::byKey('cmdInfluxPort'); - $base = config::byKey('cmdInfluxTable'); - $user = config::byKey('cmdInfluxUser', 'core', ''); - $pass = config::byKey('cmdInfluxPass', 'core', ''); - if ($url == '' || $port == '') { - return; - } - if ($base == '') { - $base = 'Jeedom'; - } - if ($user == '') { - $client = new InfluxDB\Client($url, $port); - } else { - $client = new InfluxDB\Client($url, $port, $user, $pass); - } - $database = $client->selectDB($base); - if (!$database->exists()) { - $database->create(); - } - return $database; - } catch (Exception $e) { - log::add('cmd', 'error', __('Erreur get influx database :', __FILE__) . ' ' . ' => ' . log::exception($e)); - } - return ''; - } - - public function pushInflux($_value = null) { - try { - $database = cmd::getInflux($this->getId()); - if ($database == '') { - return; - } - if ($_value === null) { - $_value = $this->execCmd(); - } - $point = $this->computeInfluxData($_value); - $result = $database->writePoints(array($point), 's'); - } catch (Exception $e) { - log::add('cmd', 'error', __('Erreur push influx sur :', __FILE__) . ' ' . ' commande : ' . $this->getHumanName() . ' => ' . log::exception($e)); - } - return; - } - - public static function dropInfluxDatabase() { - try { - $database = cmd::getInflux(); - if ($database == '') { - return; - } - $database->drop(); - } catch (Exception $e) { - log::add('cmd', 'error', __('Erreur delete influx sur :', __FILE__) . ' ' . ' => ' . log::exception($e)); - } - return; - } - - public function dropInflux() { - try { - $database = cmd::getInflux($this->getId()); - if ($database == '') { - return; - } - $query = 'DROP SERIES WHERE cmdId=\'' . $this->getId() . '\''; - $result = $database->query($query); - log::add('cmd', 'debug', 'Delete influx for ' . $this->getHumanName()); - } catch (Exception $e) { - log::add('cmd', 'error', __('Erreur delete influx sur :', __FILE__) . ' ' . ' commande : ' . $this->getHumanName() . ' => ' . log::exception($e)); - } - return; - } - - public static function sendHistoryInflux($_params) { - $cmds = array(); - if ($_params['cmd_id'] == 'all') { - foreach (cmd::byTypeSubType('info') as $cmd) { - if ($cmd->getConfiguration('influx::enable', false)) { - $cmds[] = $cmd; - } - } - } else { - $cmds[] = cmd::byId($_params['cmd_id']); - } - try { - foreach ($cmds as $cmd) { - log::add('cmd', 'info', __('Envoie de l\'historique à influx :', __FILE__) . ' ' . ' commande : ' . $cmd->getHumanName()); - $database = cmd::getInflux($cmd->getId()); - if ($database == '') { - return; - } - $oldest = $cmd->getOldest(); - $begin = date('Y-m-d H:i:s', strtotime('-60 days')); - $now = date('Y-m-d H:i:s'); - if (count($oldest) > 0) { - $begin = date('Y-m-d H:i:s', strtotime($oldest[0]->getDatetime())); - } - $end = $begin; - while ($end < date('Y-m-d H:i:s', strtotime($now . ' +60 days'))) { - $points = array(); - $history = $cmd->getHistory($begin, $end); - foreach ($history as $point) { - $value = $point->getValue(); - $timestamp = strtotime($point->getDatetime()); - $points[] = $cmd->computeInfluxData($value, $timestamp); - } - $array_points = array_chunk($points, 10000); - foreach ($array_points as $point) { - $database->writePoints($point, 's'); - } - $begin = $end; - $end = date('Y-m-d H:i:s', strtotime($begin . ' +60 days')); - } - } - } catch (Exception $e) { - log::add('cmd', 'error', __('Erreur history influx sur :', __FILE__) . ' ' . ' commande : ' . $cmd->getHumanName() . ' => ' . log::exception($e)); - } - } - - /** - * @param string|int $_type 'all' for all cmd, cmd id for specific cmd - * @return void - */ - public static function historyInflux($_type = 'all') { - $cron = new cron(); - $cron->setClass('cmd'); - $cron->setFunction('sendHistoryInflux'); - if ($_type == 'all') { - $cron->setOption(array('cmd_id' => 'all')); - } else { - $cron->setOption(array('cmd_id' => intval($_type))); - } - $cron->setLastRun(date('Y-m-d H:i:s')); - $cron->setOnce(1); - $cron->setSchedule(cron::convertDateToCron(strtotime("now") + 60)); - $cron->save(); - } - public function generateAskResponseLink($_response, $_plugin = 'core', $_network = 'external') { if ($this->getCache('ask::token') == null || $this->getCache('ask::token') == '' || strlen($this->getCache('ask::token')) < 60) { $this->setCache('ask::token', config::genKey()); @@ -2656,10 +2452,6 @@ public static function migrateCmd($_sourceId, $_targetId) { 'actionCodeAccess' => '', 'alert::messageReturnBack' => '', 'interact::auto::disable' => '', - 'influx::enable' => '', - 'influx::namecmd' => '', - 'influx::nameEq' => '', - 'influx::nameVal' => '', ]; $migrateAlertValues = [ diff --git a/core/js/cmd.class.js b/core/js/cmd.class.js index 29a91bb70f..7d321d0c01 100644 --- a/core/js/cmd.class.js +++ b/core/js/cmd.class.js @@ -719,80 +719,6 @@ jeedom.cmd.usedBy = function(_params) { domUtils.ajax(paramsAJAX) } -jeedom.cmd.dropInflux = function(_params) { - const paramsRequired = ['cmd_id'] - const paramsSpecifics = {} - try { - jeedom.private.checkParamsRequired(_params || {}, paramsRequired) - } catch (e) { - (_params.error || paramsSpecifics.error || jeedom.private.default_params.error)(e) - return - } - const params = domUtils.extend({}, jeedom.private.default_params, paramsSpecifics, _params || {}) - const paramsAJAX = jeedom.private.getParamsAJAX(params) - paramsAJAX.url = 'core/ajax/cmd.ajax.php' - paramsAJAX.data = { - action: 'dropInflux', - cmd_id: _params.cmd_id - } - domUtils.ajax(paramsAJAX) -} - -jeedom.cmd.historyInflux = function(_params) { - const paramsRequired = ['cmd_id'] - const paramsSpecifics = {} - try { - jeedom.private.checkParamsRequired(_params || {}, paramsRequired) - } catch (e) { - (_params.error || paramsSpecifics.error || jeedom.private.default_params.error)(e) - return - } - const params = domUtils.extend({}, jeedom.private.default_params, paramsSpecifics, _params || {}) - const paramsAJAX = jeedom.private.getParamsAJAX(params) - paramsAJAX.url = 'core/ajax/cmd.ajax.php' - paramsAJAX.data = { - action: 'historyInflux', - cmd_id: _params.cmd_id - } - domUtils.ajax(paramsAJAX) -} - -jeedom.cmd.dropDatabaseInflux = function(_params) { - const paramsRequired = [] - const paramsSpecifics = {} - try { - jeedom.private.checkParamsRequired(_params || {}, paramsRequired) - } catch (e) { - (_params.error || paramsSpecifics.error || jeedom.private.default_params.error)(e) - return - } - const params = domUtils.extend({}, jeedom.private.default_params, paramsSpecifics, _params || {}) - const paramsAJAX = jeedom.private.getParamsAJAX(params) - paramsAJAX.url = 'core/ajax/cmd.ajax.php' - paramsAJAX.data = { - action: 'dropDatabaseInflux' - } - domUtils.ajax(paramsAJAX) -} - -jeedom.cmd.historyInfluxAll = function(_params) { - const paramsRequired = [] - const paramsSpecifics = {} - try { - jeedom.private.checkParamsRequired(_params || {}, paramsRequired) - } catch (e) { - (_params.error || paramsSpecifics.error || jeedom.private.default_params.error)(e) - return - } - const params = domUtils.extend({}, jeedom.private.default_params, paramsSpecifics, _params || {}) - const paramsAJAX = jeedom.private.getParamsAJAX(params) - paramsAJAX.url = 'core/ajax/cmd.ajax.php' - paramsAJAX.data = { - action: 'historyInfluxAll' - } - domUtils.ajax(paramsAJAX) -} - jeedom.cmd.changeType = function(_cmd, _subType) { if(_cmd.length == 0){ return; diff --git a/desktop/js/administration.js b/desktop/js/administration.js index 22a075b700..19fd5c36c5 100644 --- a/desktop/js/administration.js +++ b/desktop/js/administration.js @@ -1113,50 +1113,6 @@ document.getElementById('summarytab').addEventListener('change', function(event) */ document.getElementById('eqlogictab').addEventListener('click', function(event) { var _target = null - if (_target = event.target.closest('#bt_influxDelete')) { - jeeDialog.confirm('{{Êtes-vous sûr de vouloir supprimer la base d\'InfluxDB}}', function(result) { - if (result) { - jeedom.cmd.dropDatabaseInflux({ - error: function(error) { - jeedomUtils.showAlert({ - message: error.message, - level: 'danger' - }) - }, - success: function(data) { - jeedomUtils.showAlert({ - message: '{{Action envoyée avec succés}}', - level: 'success' - }) - } - }) - } - }) - return - } - - if (_target = event.target.closest('#bt_influxHistory')) { - jeeDialog.confirm('{{Êtes-vous sûr de vouloir envoyer tout l\'historique de toutes les commandes avec push InfluxDB. Cela sera programmé et effectué en tâche de fond dans une minute et pourra être long selon le nombre de commandes.}}', function(result) { - if (result) { - jeedom.cmd.historyInfluxAll({ - error: function(error) { - jeedomUtils.showAlert({ - message: error.message, - level: 'danger' - }) - }, - success: function(data) { - jeedomUtils.showAlert({ - message: '{{Programmation envoyée avec succés}}', - level: 'success' - }) - } - }) - } - }) - return - } - if (_target = event.target.closest('#bt_removeHistoryInFutur')) { jeedom.history.removeHistoryInFutur({ error: function(error) { @@ -1348,7 +1304,7 @@ document.getElementById('updatetab').addEventListener('click', function(event) { }) }, success: function(data) { - window.location.reload(); + window.location.reload() } }) } diff --git a/desktop/modal/cmd.configure.php b/desktop/modal/cmd.configure.php index f3a3f3e298..b30a444468 100644 --- a/desktop/modal/cmd.configure.php +++ b/desktop/modal/cmd.configure.php @@ -199,41 +199,6 @@ - getType() == 'info') { ?> -
- -
- -
-
-
- - - - -
@@ -1302,56 +1267,6 @@ return } - if (_target = event.target.closest('#bt_influxDelete')) { - jeeDialog.confirm('{{Êtes-vous sûr de vouloir supprimer toutes les infos de cette commande d\'InfluxDB}}', function(result) { - if (result) { - jeedom.cmd.dropInflux({ - cmd_id: jeephp2js.md_cmdConfigure_cmdInfo.id, - error: function(error) { - jeedomUtils.showAlert({ - attachTo: jeeDialog.get('#div_displayCmdConfigure', 'dialog'), - message: error.message, - level: 'danger' - }) - }, - success: function(data) { - jeedomUtils.showAlert({ - attachTo: jeeDialog.get('#div_displayCmdConfigure', 'dialog'), - message: '{{Action envoyée avec succés}}', - level: 'success' - }) - } - }) - } - }) - return - } - - if (_target = event.target.closest('#bt_influxHistory')) { - jeeDialog.confirm('{{Êtes-vous sûr de vouloir envoyer tout l\'historique de cette commande à InfluxDB. Cela sera programmé et effectué en tâche de fond dans une minute.}}', function(result) { - if (result) { - jeedom.cmd.historyInflux({ - cmd_id: jeephp2js.md_cmdConfigure_cmdInfo.id, - error: function(error) { - jeedomUtils.showAlert({ - attachTo: jeeDialog.get('#div_displayCmdConfigure', 'dialog'), - message: error.message, - level: 'danger' - }) - }, - success: function(data) { - jeedomUtils.showAlert({ - attachTo: jeeDialog.get('#div_displayCmdConfigure', 'dialog'), - message: '{{Programmation envoyée avec succés}}', - level: 'success' - }) - } - }) - } - }) - return - } - if (_target = event.target.closest('#bt_cmdConfigureReplaceMeBy')) { jeedom.cmd.getSelectModal({ cmd: { @@ -1479,14 +1394,6 @@ return } - if (_target = event.target.closest('.cmdAttr[data-l2key="influx::enable"]')) { - if (_target.jeeValue() == 1) { - document.querySelectorAll('.selInflux').seen() - } else { - document.querySelectorAll('.selInflux').unseen() - } - return - } }) diff --git a/desktop/php/administration.php b/desktop/php/administration.php index f226834255..9bc61fac76 100644 --- a/desktop/php/administration.php +++ b/desktop/php/administration.php @@ -1230,44 +1230,6 @@ - {{InfluxDB}} -
-
-
- -
- -
- -
- -
-
-
- -
- -
-
-
- -
- -
- -
- -
-
-
- - -
-
-
{{Spécial}} @@ -2337,4 +2299,4 @@
- \ No newline at end of file + diff --git a/desktop/php/eqAnalyse.php b/desktop/php/eqAnalyse.php index 1ad94153b2..e4ae45dde4 100644 --- a/desktop/php/eqAnalyse.php +++ b/desktop/php/eqAnalyse.php @@ -186,8 +186,7 @@ foreach (($eqLogic->getCmd('info')) as $cmd) { $timelineEnable = $cmd->getConfiguration('timeline::enable', false); $pushEnable = $cmd->getConfiguration('jeedomPushUrl', ''); - $influxEnable = $cmd->getConfiguration('influx::enable', false); - if ($timelineEnable || $pushEnable != '' || $influxEnable) { + if ($timelineEnable || $pushEnable != '') { $div .= '' . $eqLogic->getHumanName(true) . '' . $cmd->getName() . ' (' . $cmd->getId() . ')'; if ($timelineEnable) { $folder = ''; @@ -196,17 +195,6 @@ } $div .= '
- {{Timeline active}}' . $folder . '
'; } - if ($influxEnable) { - $nameCmd = $cmd->getName(); - $nameEqLogic = $eqLogic->getName(); - if ($cmd->getConfiguration('influx::namecmd', '') != '') { - $nameCmd = $cmd->getConfiguration('influx::namecmd'); - } - if ($cmd->getConfiguration('influx::nameEq', '') != '') { - $nameEqLogic = $cmd->getConfiguration('influx::nameEq'); - } - $div .= '
- {{Influx actif}} : ' . $nameCmd . '-' . $nameEqLogic . '
'; - } if ($pushEnable != '') { $div .= '
- {{Push actif sur}} : ' . $pushEnable . '
'; } diff --git a/docs/fr_FR/administration.md b/docs/fr_FR/administration.md index 76d241cfd5..fd2aa75926 100644 --- a/docs/fr_FR/administration.md +++ b/docs/fr_FR/administration.md @@ -172,10 +172,6 @@ En dessous vous retrouvez un tableau permettant de gérer finement le niveau de De nombreuses commandes peuvent être historisées. Ainsi, dans Analyse→Historique, vous obtenez des graphiques représentant leur utilisation. Cet onglet permet de fixer des paramètres globaux à l’historisation des commandes. ->**InfluxDB** -> ->Si vous voulez utilisez InfluxDB pour le moment il faut installer vous-même la bibliothèque InfluxDB, Jeedom ne le faisant plus car elle n'est plus maintenue (nous prévoyons de migrer sur la nouvelle version mais cela ne sera pas pour tout de suite). Pour faire l'installation manuelle voilà comment faire : `cd /var/www/html;composer require influxdb/influxdb-php` depuis configuration puis onglet OS/DB puis la console d'administration OS - ### Historique des commandes - **Afficher les statistiques sur les widgets** : Permet d’afficher les statistiques sur les widgets. Il faut que le widget soit compatible, ce qui est le cas pour la plupart. Il faut aussi que la commande soit de type numérique. diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index f7147e9cee..f5cfcd992b 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1,5 +1,17 @@ parameters: ignoreErrors: + - + message: '#^Static method cache\:\:set\(\) invoked with 4 parameters, 2\-3 required\.$#' + identifier: arguments.count + count: 1 + path: core/ajax/cache.ajax.php + + - + message: '#^Static method history\:\:getHistoryFromCalcul\(\) invoked with 6 parameters, 1\-5 required\.$#' + identifier: arguments.count + count: 1 + path: core/ajax/cmd.ajax.php + - message: '#^Variable \$eqLogic might not be defined\.$#' identifier: variable.undefined @@ -55,16 +67,40 @@ parameters: path: core/api/jeeApi.php - - message: '#^Instantiated class InfluxDB\\Client not found\.$#' + message: '#^Call to static method byId\(\) on an unknown class jeeNetwork\.$#' + identifier: class.notFound + count: 1 + path: core/api/proApi.php + + - + message: '#^Call to static method byId\(\) on an unknown class market\.$#' identifier: class.notFound count: 2 - path: core/class/cmd.class.php + path: core/api/proApi.php - - message: '#^Instantiated class InfluxDB\\Point not found\.$#' + message: '#^Call to static method byLogicalId\(\) on an unknown class market\.$#' identifier: class.notFound + count: 1 + path: core/api/proApi.php + + - + message: '#^Call to static method testMaster\(\) on an unknown class jeeNetwork\.$#' + identifier: class.notFound + count: 1 + path: core/api/proApi.php + + - + message: '#^Static method jeedom\:\:update\(\) invoked with 2 parameters, 0\-1 required\.$#' + identifier: arguments.count count: 2 - path: core/class/cmd.class.php + path: core/api/proApi.php + + - + message: '#^Static method repo_market\:\:backup_restore\(\) invoked with 2 parameters, 1 required\.$#' + identifier: arguments.count + count: 1 + path: core/api/proApi.php - message: '#^Variable \$goupingType might not be defined\.$#'