-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE] Compatibility with TYPO3 v11 and PHP 8.1 (#22)
Raises version to 1.2.0
- Loading branch information
Showing
8 changed files
with
107 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Pixelant\Qbank\Utility; | ||
|
||
/* | ||
* This file is part of the TYPO3 CMS project. | ||
* | ||
* It is free software; you can redistribute it and/or modify it under | ||
* the terms of the GNU General Public License, either version 2 | ||
* of the License, or any later version. | ||
* | ||
* For the full copyright and license information, please read the | ||
* LICENSE.txt file that was distributed with this source code. | ||
* | ||
* The TYPO3 project - inspiring people to share! | ||
*/ | ||
|
||
use TYPO3\CMS\Core\Utility\VersionNumberUtility; | ||
|
||
/** | ||
* Miscellaneous functions relating to compatibility with different TYPO3 versions | ||
*/ | ||
class CompatibilityUtility | ||
{ | ||
/** | ||
* Returns true if the current TYPO3 version is less than $version | ||
* | ||
* @param string $version | ||
* @return bool | ||
*/ | ||
public static function typo3VersionIsLessThan(string $version) | ||
{ | ||
return self::getTypo3VersionInteger() < VersionNumberUtility::convertVersionNumberToInteger($version); | ||
} | ||
|
||
/** | ||
* Returns true if the current TYPO3 version is less than or equal to $version | ||
* | ||
* @param string $version | ||
* @return bool | ||
*/ | ||
public static function typo3VersionIsLessThanOrEqualTo(string $version) | ||
{ | ||
return self::getTypo3VersionInteger() <= VersionNumberUtility::convertVersionNumberToInteger($version); | ||
} | ||
|
||
/** | ||
* Returns true if the current TYPO3 version is greater than $version | ||
* | ||
* @param string $version | ||
* @return bool | ||
*/ | ||
public static function typo3VersionIsGreaterThan(string $version) | ||
{ | ||
return self::getTypo3VersionInteger() > VersionNumberUtility::convertVersionNumberToInteger($version); | ||
} | ||
|
||
/** | ||
* Returns true if the current TYPO3 version is greater than or equal to $version | ||
* | ||
* @param string $version | ||
* @return bool | ||
*/ | ||
public static function typo3VersionIsGreaterThanOrEqualTo(string $version) | ||
{ | ||
return self::getTypo3VersionInteger() >= VersionNumberUtility::convertVersionNumberToInteger($version); | ||
} | ||
|
||
/** | ||
* Returns the TYPO3 version as an integer | ||
* | ||
* @return int | ||
*/ | ||
public static function getTypo3VersionInteger() | ||
{ | ||
return VersionNumberUtility::convertVersionNumberToInteger(VersionNumberUtility::getNumericTypo3Version()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters