diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index ab725be1..716b5802 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -17,11 +17,8 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0'] + php: ['7.2', '7.3', '7.4', '8.0', '8.1'] os: ['ubuntu-latest'] - include: - - php: '7.0' - allow_failure: true steps: - name: Checkout code base diff --git a/README.md b/README.md index d9f8eefe..45a28a44 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Icinga DB Web -[![PHP Support](https://img.shields.io/badge/php-%3E%3D%207.0-777BB4?logo=PHP)](https://php.net/) +[![PHP Support](https://img.shields.io/badge/php-%3E%3D%207.2-777BB4?logo=PHP)](https://php.net/) ![Build Status](https://github.com/icinga/icingaweb2-module-icingadb/workflows/PHP%20Tests/badge.svg?branch=master) [![Github Tag](https://img.shields.io/github/tag/Icinga/icingaweb2-module-icingadb.svg)](https://github.com/Icinga/icingaweb2-module-icingadb) diff --git a/doc/02-Installation.md b/doc/02-Installation.md index 4dc4b6f8..9d29db45 100644 --- a/doc/02-Installation.md +++ b/doc/02-Installation.md @@ -6,14 +6,13 @@ ## Requirements -* PHP (>= 7.3) - * Older versions (7.0+) still work, but may stop doing so with near future updates +* PHP (>= 7.2) * MySQL or PostgreSQL PHP libraries * The following PHP modules must be installed: cURL, dom, json, libxml, pdo * [Icinga DB](https://github.com/Icinga/icingadb) * [Icinga Web 2](https://github.com/Icinga/icingaweb2) (>= 2.9) -* [Icinga PHP Library (ipl)](https://github.com/Icinga/icinga-php-library) (>= 0.7) -* [Icinga PHP Thirdparty](https://github.com/Icinga/icinga-php-thirdparty) (>= 0.10) +* [Icinga PHP Library (ipl)](https://github.com/Icinga/icinga-php-library) (>= 0.9) +* [Icinga PHP Thirdparty](https://github.com/Icinga/icinga-php-thirdparty) (>= 0.11) * For exports to PDF the [pdfexport](https://github.com/Icinga/icingaweb2-module-pdfexport) (>= 0.10) module is required (Optional) diff --git a/library/Icingadb/Model/Behavior/Bitmask.php b/library/Icingadb/Model/Behavior/Bitmask.php index 0207589e..f8d91f62 100644 --- a/library/Icingadb/Model/Behavior/Bitmask.php +++ b/library/Icingadb/Model/Behavior/Bitmask.php @@ -62,7 +62,7 @@ class Bitmask extends PropertyBehavior implements RewriteFilterBehavior $values = $condition->getValue(); if (! is_array($values)) { - if (ctype_digit($values)) { + if (is_int($values) || ctype_digit($values)) { return; } diff --git a/library/Icingadb/Model/Behavior/IdKey.php b/library/Icingadb/Model/Behavior/IdKey.php index ddc903df..bdad3c16 100644 --- a/library/Icingadb/Model/Behavior/IdKey.php +++ b/library/Icingadb/Model/Behavior/IdKey.php @@ -19,7 +19,7 @@ class IdKey implements RewriteFilterBehavior $column = $condition->metaData()->get('columnName'); if ($column === 'id' || substr($column, -3) === '_id') { $value = $condition->getValue(); - if ($value && ctype_alnum($value)) { + if ($value && is_string($value) && ctype_alnum($value)) { $condition->setValue(hex2bin($value)); } } diff --git a/library/Icingadb/Model/Behavior/Timestamp.php b/library/Icingadb/Model/Behavior/Timestamp.php index b29b3d62..b3654910 100644 --- a/library/Icingadb/Model/Behavior/Timestamp.php +++ b/library/Icingadb/Model/Behavior/Timestamp.php @@ -23,7 +23,7 @@ class Timestamp extends PropertyBehavior return $value; } - if (! ctype_digit($value)) { + if (is_string($value) && ! ctype_digit($value)) { $timestamp = strtotime($value); if ($timestamp === false) { return $value; diff --git a/library/Icingadb/Redis/VolatileStateResults.php b/library/Icingadb/Redis/VolatileStateResults.php index d65e8bef..86cceb7a 100644 --- a/library/Icingadb/Redis/VolatileStateResults.php +++ b/library/Icingadb/Redis/VolatileStateResults.php @@ -27,7 +27,7 @@ class VolatileStateResults extends ResultSet return parent::current(); } - public function key() + public function key(): int { if (! $this->updatesApplied && ! $this->isCacheDisabled) { $this->rewind(); @@ -36,7 +36,7 @@ class VolatileStateResults extends ResultSet return parent::key(); } - public function rewind() + public function rewind(): void { if (! $this->updatesApplied && ! $this->isCacheDisabled) { $this->updatesApplied = true; diff --git a/library/Icingadb/Setup/IcingaDbWizard.php b/library/Icingadb/Setup/IcingaDbWizard.php index 5c3b45a0..2ad514a5 100644 --- a/library/Icingadb/Setup/IcingaDbWizard.php +++ b/library/Icingadb/Setup/IcingaDbWizard.php @@ -4,7 +4,6 @@ namespace Icinga\Module\Icingadb\Setup; -use Icinga\Application\Platform; use Icinga\Module\Setup\Forms\SummaryPage; use Icinga\Module\Setup\Requirement\PhpModuleRequirement; use Icinga\Module\Setup\Requirement\PhpVersionRequirement; @@ -51,35 +50,19 @@ class IcingaDbWizard extends Wizard implements SetupWizard { $set = new RequirementSet(); - $phpVersion = Platform::getPhpVersion(); - - if ( - version_compare($phpVersion, '7.0', '>=') - && version_compare($phpVersion, '7.3', '<') - ) { - $set->add(new PhpVersionRequirement([ - 'optional' => true, - 'condition' => ['>=', '7.3'], - 'description' => t( - 'For Icinga DB Web PHP 7.3+ is highly recommended.' - . ' Older versions still work, but may stop doing so with near future updates.' - ) - ])); - } else { - $set->add(new PhpVersionRequirement([ - 'condition' => ['>=', '7.3'], - 'description' => t('Icinga DB Web requires PHP version 7.3.') - ])); - } + $set->add(new PhpVersionRequirement([ + 'condition' => ['>=', '7.2'], + 'description' => sprintf(t('Icinga DB Web requires PHP version %s.'), '7.2') + ])); $set->add(new WebLibraryRequirement([ - 'condition' => ['icinga-php-library', '>=', '0.7.0'], + 'condition' => ['icinga-php-library', '>=', '0.9.0'], 'alias' => 'Icinga PHP library', 'description' => t('The Icinga PHP library (IPL) is required for Icinga DB Web') ])); $set->add(new WebLibraryRequirement([ - 'condition' => ['icinga-php-thirdparty', '>=', '0.10.0'], + 'condition' => ['icinga-php-thirdparty', '>=', '0.11.0'], 'alias' => 'Icinga PHP Thirdparty', 'description' => t('The Icinga PHP Thirdparty library is required for Icinga DB Web') ])); diff --git a/library/Icingadb/Widget/Detail/ObjectDetail.php b/library/Icingadb/Widget/Detail/ObjectDetail.php index 2aeb6475..c2898ed5 100644 --- a/library/Icingadb/Widget/Detail/ObjectDetail.php +++ b/library/Icingadb/Widget/Detail/ObjectDetail.php @@ -17,11 +17,11 @@ use Icinga\Module\Icingadb\Common\HostLinks; use Icinga\Module\Icingadb\Common\Icons; use Icinga\Module\Icingadb\Common\Links; use Icinga\Module\Icingadb\Common\Macros; +use Icinga\Module\Icingadb\Compat\CompatHost; use Icinga\Module\Icingadb\Model\CustomvarFlat; use Icinga\Module\Icingadb\Web\Navigation\Action; use Icinga\Module\Icingadb\Widget\MarkdownText; use Icinga\Module\Icingadb\Common\ServiceLinks; -use Icinga\Module\Icingadb\Compat\CompatObject; use Icinga\Module\Icingadb\Forms\Command\Object\ToggleObjectFeaturesForm; use Icinga\Module\Icingadb\Hook\ActionsHook\ObjectActionsHook; use Icinga\Module\Icingadb\Hook\ExtensionHook\ObjectDetailExtensionHook; @@ -34,7 +34,6 @@ use Icinga\Module\Icingadb\Widget\EmptyState; use Icinga\Module\Icingadb\Widget\StateChange; use ipl\Web\Widget\HorizontalKeyValue; use Icinga\Module\Icingadb\Widget\ItemList\CommentList; -use Icinga\Module\Icingadb\Widget\Detail\PerfDataTable; use Icinga\Module\Icingadb\Widget\PluginOutputContainer; use Icinga\Module\Icingadb\Widget\ShowMore; use Icinga\Module\Icingadb\Widget\TagList; @@ -75,7 +74,7 @@ class ObjectDetail extends BaseHtmlElement public function __construct($object) { $this->object = $object; - $this->compatObject = CompatObject::fromModel($object); + $this->compatObject = CompatHost::fromModel($object); $this->objectType = $object instanceof Host ? 'host' : 'service'; } diff --git a/module.info b/module.info index 379ee174..c4e497f7 100644 --- a/module.info +++ b/module.info @@ -1,6 +1,6 @@ Module: icingadb Version: 1.0.0-rc2 Requires: - Libraries: icinga-php-library (>=0.7.0), icinga-php-thirdparty (>=0.10.0) + Libraries: icinga-php-library (>=0.9.0), icinga-php-thirdparty (>=0.11.0) Description: Icinga DB Web UI for Icinga DB – Provides a graphical interface to your Icinga monitoring