Skip to content

Commit

Permalink
Merge pull request #47 from WapplerSystems/release/v12-dev
Browse files Browse the repository at this point in the history
Release/v12 dev
  • Loading branch information
svewap authored Apr 21, 2024
2 parents dea15b1 + 69433b5 commit 14289dc
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 5 deletions.
58 changes: 58 additions & 0 deletions Classes/Operation/GetSupportState.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?php

namespace WapplerSystems\ZabbixClient\Operation;

/**
* This file is part of the "zabbix_client" Extension for TYPO3 CMS.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*/

use TYPO3\CMS\Core\SingletonInterface;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Install\Service\Exception\RemoteFetchException;
use WapplerSystems\ZabbixClient\Attribute\MonitoringOperation;
use WapplerSystems\ZabbixClient\OperationResult;
use WapplerSystems\ZabbixClient\Service\CoreVersionService;


/**
*
*/
#[MonitoringOperation('GetSupportState')]
class GetSupportState implements IOperation, SingletonInterface
{

/**
*
* @param array $parameter None
* @return OperationResult
*/
public function execute($parameter = []): OperationResult
{

/** @var CoreVersionService $coreVersionService */
$coreVersionService = GeneralUtility::makeInstance(CoreVersionService::class);

// No updates for development versions
if (!$coreVersionService->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');
}
}
10 changes: 5 additions & 5 deletions Classes/Operation/GetTYPO3Version.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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());
}
}
3 changes: 3 additions & 0 deletions Classes/Operation/HasIPTCPreservation.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

0 comments on commit 14289dc

Please sign in to comment.