From a7a296ea9296c869dab85dfdfe275dffc2d85ab3 Mon Sep 17 00:00:00 2001 From: Sven Wappler Date: Sat, 20 Apr 2024 01:22:16 +0200 Subject: [PATCH 1/3] typo3 version as integer --- Classes/Operation/GetTYPO3Version.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Classes/Operation/GetTYPO3Version.php b/Classes/Operation/GetTYPO3Version.php index 0b1cac1..440304a 100644 --- a/Classes/Operation/GetTYPO3Version.php +++ b/Classes/Operation/GetTYPO3Version.php @@ -10,10 +10,9 @@ */ use TYPO3\CMS\Core\SingletonInterface; +use TYPO3\CMS\Core\Utility\VersionNumberUtility; use WapplerSystems\ZabbixClient\Attribute\MonitoringOperation; use WapplerSystems\ZabbixClient\OperationResult; -use TYPO3\CMS\Core\Utility\GeneralUtility; -use TYPO3\CMS\Core\Information\Typo3Version; /** * A Operation which returns the current TYPO3 version @@ -27,8 +26,9 @@ class GetTYPO3Version implements IOperation, SingletonInterface */ public function execute(array $parameter = []): OperationResult { - $typo3Version = GeneralUtility::makeInstance(Typo3Version::class); - - return new OperationResult(true, $typo3Version->getVersion()); + if (((int)($parameter['asInteger'] ?? 0)) === 1) { + return new OperationResult(true, VersionNumberUtility::convertVersionNumberToInteger(VersionNumberUtility::getCurrentTypo3Version())); + } + return new OperationResult(true, VersionNumberUtility::getCurrentTypo3Version()); } } From a148af03211a7744d3bf6cd6579a9b93334999fb Mon Sep 17 00:00:00 2001 From: Sven Wappler Date: Sun, 21 Apr 2024 19:40:57 +0200 Subject: [PATCH 2/3] add GetSupportState operation --- Classes/Operation/GetSupportState.php | 58 +++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 Classes/Operation/GetSupportState.php diff --git a/Classes/Operation/GetSupportState.php b/Classes/Operation/GetSupportState.php new file mode 100644 index 0000000..3230817 --- /dev/null +++ b/Classes/Operation/GetSupportState.php @@ -0,0 +1,58 @@ +isInstalledVersionAReleasedVersion()) { + return new OperationResult(true, ''); + } + + try { + $versionMaintenanceWindow = $coreVersionService->getMaintenanceWindow(); + } catch (RemoteFetchException $remoteFetchException) { + return new OperationResult(false, false); + } + + if ($versionMaintenanceWindow->isSupportedByCommunity()) { + return new OperationResult(true, 'community'); + } + + if ($versionMaintenanceWindow->isSupportedByElts()) { + return new OperationResult(true, 'elts'); + } + return new OperationResult(true, 'outdated'); + } +} From 69433b5942735dc74dd750d8efb334ea570386ec Mon Sep 17 00:00:00 2001 From: Sven Wappler Date: Sun, 21 Apr 2024 19:42:08 +0200 Subject: [PATCH 3/3] issue #41 --- Classes/Operation/HasIPTCPreservation.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Classes/Operation/HasIPTCPreservation.php b/Classes/Operation/HasIPTCPreservation.php index f65e4e3..b2ed7ea 100644 --- a/Classes/Operation/HasIPTCPreservation.php +++ b/Classes/Operation/HasIPTCPreservation.php @@ -32,6 +32,9 @@ class HasIPTCPreservation implements IOperation, SingletonInterface */ public function execute(array $parameter = []): OperationResult { + if (isset($GLOBALS['TYPO3_CONF_VARS']['GFX']['processor_stripColorProfileParameters'])) { + return new OperationResult(true, (bool)array_search('!iptc', $GLOBALS['TYPO3_CONF_VARS']['GFX']['processor_stripColorProfileParameters'] ?? []) !== false); + } return new OperationResult(true, strpos($GLOBALS['TYPO3_CONF_VARS']['GFX']['processor_stripColorProfileCommand'] ?? '','!iptc') !== false); } }