Skip to content

Commit

Permalink
typo3 12 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Sven Wappler committed Feb 18, 2023
1 parent 54036a5 commit f299d8d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
8 changes: 7 additions & 1 deletion Classes/Utility/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
namespace WapplerSystems\ZabbixClient\Utility;

use TYPO3\CMS\Core\Configuration\ExtensionConfiguration;
use TYPO3\CMS\Core\Information\Typo3Version;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;
use TYPO3\CMS\Extbase\Object\ObjectManager;
Expand All @@ -14,6 +15,11 @@ class Configuration
*/
public static function getExtConfiguration()
{
if (class_exists(Typo3Version::class)) {
return \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(ExtensionConfiguration::class)
->get('zabbix_client');
}

if (version_compare(TYPO3_version, '9.0.0', '>=')) {

return \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(ExtensionConfiguration::class)
Expand Down Expand Up @@ -45,4 +51,4 @@ public static function getTypoScriptConfiguration(): array
);
}

}
}
8 changes: 3 additions & 5 deletions ext_localconf.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<?php

if (!defined('TYPO3_MODE')) {
die('Access denied.');
}
defined('TYPO3') or die();

if (!isset($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['zabbix_client']['operations'])) {
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['zabbix_client']['operations'] = [];
Expand Down Expand Up @@ -40,7 +38,7 @@
'HasIPTCPreservation' => \WapplerSystems\ZabbixClient\Operation\HasIPTCPreservation::class,
]);

if (version_compare(TYPO3_version, '9.0.0', '>=')) {
if (defined('TYPO3_version') && version_compare(TYPO3_version, '9.0.0', '>=')) {
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['zabbix_client']['operations'] = array_merge($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['zabbix_client']['operations'],[
'HasStrictSyntaxEnabled' => \WapplerSystems\ZabbixClient\Operation\HasStrictSyntaxEnabled::class,
]);
Expand All @@ -59,6 +57,6 @@
],
];

if (version_compare(TYPO3_version, '9.0.0', '<') && version_compare(TYPO3_version, '7.4.0', '>=')) {
if (defined('TYPO3_version') && version_compare(TYPO3_version, '9.0.0', '<') && version_compare(TYPO3_version, '7.4.0', '>=')) {
$GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['zabbixclient'] = \WapplerSystems\ZabbixClient\Middleware\Eid::class . '::processRequest';
}
5 changes: 0 additions & 5 deletions ext_tables.php

This file was deleted.

0 comments on commit f299d8d

Please sign in to comment.