Commit 11c55741 authored by Thomas Löffler's avatar Thomas Löffler
Browse files

[TASK] Use rector for v11 compatibility of EXT:ter

parent cc77a576
Pipeline #22187 failed with stages
in 3 minutes and 25 seconds
......@@ -19,6 +19,7 @@ use T3o\Ter\Exception\InvalidExtensionKeyFormatException;
use T3o\Ter\Exception\UnauthorizedException;
use T3o\Ter\Exception\UserNotFoundException;
use T3o\Ter\Exception\VersionExistsException;
use TYPO3\CMS\Core\Context\Context;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Database\Query\Restriction\FrontendRestrictionContainer;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
......@@ -151,10 +152,12 @@ class ExtensionKey
throw new UserNotFoundException('The requested user does not exist, so it cannot be used as owner');
}
$time = GeneralUtility::makeInstance(Context::class)->getPropertyFromAspect('date', 'timestamp');
$extensionKeysRow = [
'pid' => GeneralUtility::makeInstance(Configuration::class)->getStoragePid(),
'tstamp' => $GLOBALS['EXEC_TIME'],
'crdate' => $GLOBALS['EXEC_TIME'],
'tstamp' => $time,
'crdate' => $time,
'ext_key' => $this->extensionKey,
'frontend_user' => $ownerUserName,
'last_upload' => 0,
......@@ -340,7 +343,7 @@ class ExtensionKey
// Bad prefixes:
$badPrefixesArr = ['tx', 'user_', 'pages', 'tt_', 'sys_', 'ts_language_', 'csh_'];
foreach ($badPrefixesArr as $prefix) {
if (GeneralUtility::isFirstPartOfStr($extensionKey, $prefix)) {
if (\str_starts_with($extensionKey, $prefix)) {
return false;
}
}
......@@ -357,7 +360,7 @@ class ExtensionKey
$connection->update(
'tx_terfe2_domain_model_extension',
[
'tstamp' => $GLOBALS['SIM_EXEC_TIME'],
'tstamp' => GeneralUtility::makeInstance(Context::class)->getPropertyFromAspect('date', 'timestamp'),
'versions' => $this->getNumberOfVersions(),
'last_version' => $this->getHighestVersion()
],
......
......@@ -25,6 +25,7 @@ use T3o\TerFe2\Utility\ArchiveUtility;
use T3o\TerFe2\Utility\CategoryUtility;
use T3o\TerFe2\Utility\VersionUtility;
use TYPO3\CMS\Core\Cache\CacheManager;
use TYPO3\CMS\Core\Context\Context;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Mail\FluidEmail;
use TYPO3\CMS\Core\Mail\Mailer;
......@@ -523,18 +524,19 @@ class ExtensionVersion
$category = (string)$extensionInfoData->metaData->category;
$t3xFile = $this->getStoragePrefix() . '.t3x';
$time = (int)GeneralUtility::makeInstance(Context::class)->getPropertyFromAspect('date', 'timestamp');
$insertVersion = [
'pid' => GeneralUtility::makeInstance(Configuration::class)->getStoragePid(),
'crdate' => (int)$GLOBALS['SIM_EXEC_TIME'],
'tstamp' => (int)$GLOBALS['SIM_EXEC_TIME'],
'crdate' => $time,
'tstamp' => $time,
'extension' => $extUid,
'title' => $extensionInfoData->metaData->title,
'description' => $extensionInfoData->metaData->description,
'author' => $this->createAuthor($extensionInfoData->metaData, $uploaderUserName),
'version_number' => VersionNumberUtility::convertVersionNumberToInteger($this->version),
'version_string' => $this->version,
'upload_date' => $GLOBALS['SIM_EXEC_TIME'],
'upload_date' => $time,
'upload_comment' => (string)$extensionInfoData->infoData->uploadComment,
'file_hash' => $t3xCheckSum,
'download_counter' => 0,
......
<?php
if (!defined('TYPO3_MODE')) {
if (!defined('TYPO3')) {
die('Access denied.');
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment