Skip to content

Commit

Permalink
[RELEASE] Version 9.5.0 with performance improvements, sorting publis…
Browse files Browse the repository at this point in the history
  • Loading branch information
vertexvaar committed Jul 22, 2021
2 parents bf72e11 + d0058ac commit a2859dc
Show file tree
Hide file tree
Showing 59 changed files with 886 additions and 106 deletions.
51 changes: 50 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,54 @@
# In2publish Core Change Log

9.5.0:

- [META] Set the branch alias version number to 9.5.x-dev
- [META] Set the EM conf version number to 9.5.0
- [CLEANUP] Remove superfluous empty lines and add ones where appropriate
- [CLEANUP] Remove unused imports and superfluous lines in import sections
- [BUGFIX] Always create the additional redirects fields if the extension is installed
- [BUGFIX] Allow null as return value in FalIndexPostProcessor::getStorage
- [BUGFIX] Register the RedirectsSupport SQL slot in all TYPO3 modes
- [BUGFIX] Use the deprecated Connection::fetchAll for TYPO3 v9 compatibility
- [FEATURE] Include the sites config in the sysinfo export
- [FEATURE] Respect rootLevel, allowedTables and skip empty tables or missing PIDs
- [BUGFIX] Respect TCA rootLevel and PAGES_TYPES allowedTables when searching for related records by PID
- [FEATURE] Move the rootLevel decision to the TcaService, merge all SkipTableVoters
- [FEATURE] Create SkipRootLevelVoter to skip searching for records in tables not allowed on that page
- [FEATURE] Lazy register SkipTableByPidVoter, lazy init tables
- [FEATURE] Add Signal to skip searching for records by pid if no such PID exists
- [BUGFIX] Skip post processing of sys_file records which do not exist
- [BUGFIX] Return the DatabaseFields slot arguments as array
- [BUGFIX] Add SQL and TCA for sys_redirects only when EXT:redirects is loaded
- [CODESTYLE] Add empty line before multi-line condition
- [BUGFIX] Add missing return type hints commands
- [FEATURE] Lazily inspect if tables are empty, log query stats
- [FEATURE] Lazy register the SkipTableVoter and use an object instead of class name
- [BUGFIX] Remove spamming debug logger
- [REFACTOR] Use a single method to set the rows index
- [FEATURE] Add a SkipTableVoter to skip querying empty tables
- [BUGFIX] Try to get a cached record when searching by an identifier
- [CLEANUP] Remove useless logging of relation recursion
- [CODESTYLE] Remove blank line between import groups in BaseRepo
- [BUGFIX] Use eq() instead of like() for int values (fixes #84 closes #85)
- [BUGFIX] Set the parent record of translated records
- [FEATURE] Add feature "publishSorting" to publish the sortings of all affected records
- [REFACTOR] Simplify the sorting collecting and publishing
- [CODESTYLE] Indent the config definer on the "chop level"
- [BUGFIX] Respect the publishSorting enable setting
- [CODESTYLE] Reformat code
- [REFACTOR] Get name of sorting field from tca
- [REFACTOR] Add return type hints
- [CLEANUP] Remove unused use statements and initialization of variables
- [CLEANUP] Remove unused variable
- [BUGFIX] Fix field name for enable field in PublishSortingDefiner
- [COMMENT] Adjust comments
- [BUGFIX] Remove static pid used for testing
- [TASK] Enable publishing of changes on sorting
- [BUGFIX] Removed duplicate file name (closes #83)
- [RELEASE] Version 9.4.0 with redirects support


9.4.0:

- [META] Set the branch alias version number to 9.4.x-dev
Expand Down Expand Up @@ -455,7 +504,6 @@
- [BUGFIX] Remove type hint and add null type to the return annotation of CommonRepository::findByIdentifierInOtherTable
- [RELEASE] Version 8.0.3 with TCA user error prevention, CLI dispatching fix and T3URN parsing enhancement


8.0.3:

- [META] Set the EM conf version number to 8.0.3
Expand Down Expand Up @@ -1217,6 +1265,7 @@
- [TASK] Declare non-public API commands as internal

5.0.0:

- [RELEASE] Release in2publish_core alpha 1
- [TASK] Remove surplus features

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function isEnabled()
return GeneralUtility::makeInstance(ContextService::class)->isForeign();
}

protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$taskRepository = GeneralUtility::makeInstance(TaskRepository::class);
$result = [];
Expand Down
2 changes: 1 addition & 1 deletion Classes/Command/RemoteProcedureCall/ExecuteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function isEnabled()
return GeneralUtility::makeInstance(ContextService::class)->isForeign();
}

protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$errOutput = $output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output;

Expand Down
2 changes: 1 addition & 1 deletion Classes/Command/Status/AllCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ protected function configure()
->setHidden(true);
}

protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$commandRegistry = GeneralUtility::makeInstance(CommandRegistry::class);
$commandRegistry->getCommandByIdentifier(VersionCommand::IDENTIFIER)->execute($input, $output);
Expand Down
2 changes: 1 addition & 1 deletion Classes/Command/Status/ConfigFormatTestCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ protected function configure()
->setHidden(true);
}

protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$container = GeneralUtility::makeInstance(ValidationContainer::class);
$configContainer = GeneralUtility::makeInstance(ConfigContainer::class);
Expand Down
2 changes: 1 addition & 1 deletion Classes/Command/Status/CreateMasksCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ protected function configure()
->setHidden(true);
}

protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$output->writeln('FileCreateMask: ' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['fileCreateMask']);
$output->writeln('FolderCreateMask: ' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['folderCreateMask']);
Expand Down
2 changes: 1 addition & 1 deletion Classes/Command/Status/DbConfigTestCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ protected function configure()
->setHidden(true);
}

protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$queryBuilder = DatabaseUtility::buildLocalDatabaseConnection()->createQueryBuilder();
$predicates = $queryBuilder->expr()->eq(
Expand Down
2 changes: 1 addition & 1 deletion Classes/Command/Status/DbInitQueryEncodedCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ protected function configure()
->setHidden(true);
}

protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$dbInit = '';
if (!empty($GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default']['initCommands'])) {
Expand Down
2 changes: 1 addition & 1 deletion Classes/Command/Status/EncryptionKeyCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ protected function configure()
->setHidden(true);
}

protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$output->writeln('EKey: ' . base64_encode($GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey']));
return 0;
Expand Down
2 changes: 1 addition & 1 deletion Classes/Command/Status/GlobalConfigurationCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ protected function configure()
->setHidden(true);
}

protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$utf8fileSystem = empty($GLOBALS['TYPO3_CONF_VARS']['SYS']['UTF8filesystem'])
? 'empty'
Expand Down
2 changes: 1 addition & 1 deletion Classes/Command/Status/ShortSiteConfigurationCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ protected function configure()
->setHidden(true);
}

protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$siteFinder = GeneralUtility::makeInstance(SiteFinder::class);
$shortInfo = [];
Expand Down
1 change: 0 additions & 1 deletion Classes/Command/Status/SiteConfigurationCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
use TYPO3\CMS\Core\Exception\SiteNotFoundException;
use TYPO3\CMS\Core\Site\SiteFinder;
use TYPO3\CMS\Core\Utility\GeneralUtility;

use TYPO3\CMS\Core\Utility\RootlineUtility;

use function base64_encode;
Expand Down
2 changes: 1 addition & 1 deletion Classes/Command/Status/Typo3VersionCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ protected function configure()
->setHidden(true);
}

protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$output->writeln('TYPO3: ' . TYPO3_version);
return 0;
Expand Down
2 changes: 1 addition & 1 deletion Classes/Command/Status/VersionCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ protected function configure()
->setHidden(true);
}

protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$output->writeln('Version: ' . ExtensionUtility::getExtensionVersion('in2publish_core'));
return 0;
Expand Down
2 changes: 1 addition & 1 deletion Classes/Command/Table/BackupCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ protected function configure()
->addArgument(self::ARG_TABLE_NAME, InputArgument::REQUIRED, self::ARG_TABLE_NAME_DESCRIPTION);
}

protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$tableName = $input->getArgument(self::ARG_TABLE_NAME);
$logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(static::class);
Expand Down
2 changes: 1 addition & 1 deletion Classes/Command/Table/ImportCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function isEnabled()
return GeneralUtility::makeInstance(ContextService::class)->isLocal();
}

protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$errOutput = $output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output;
$logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(static::class);
Expand Down
2 changes: 1 addition & 1 deletion Classes/Command/Table/PublishCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function isEnabled()
return GeneralUtility::makeInstance(ContextService::class)->isLocal();
}

protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$errOutput = $output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output;
$logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(static::class);
Expand Down
2 changes: 1 addition & 1 deletion Classes/Command/Tools/TestCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function isEnabled()
return GeneralUtility::makeInstance(ContextService::class)->isLocal();
}

protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$errOutput = $output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output;
$testingService = GeneralUtility::makeInstance(TestingService::class);
Expand Down
3 changes: 0 additions & 3 deletions Classes/Controller/FileController.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
use In2code\In2publishCore\Domain\Model\RecordInterface;
use In2code\In2publishCore\Domain\Repository\CommonRepository;
use In2code\In2publishCore\Domain\Service\Publishing\FolderPublisherService;
use In2code\In2publishCore\Utility\DatabaseUtility;
use RuntimeException;
use Throwable;
use TYPO3\CMS\Core\Messaging\AbstractMessage;
Expand All @@ -48,9 +47,7 @@
use TYPO3\CMS\Extbase\SignalSlot\Exception\InvalidSlotReturnException;
use TYPO3\CMS\Extbase\Utility\LocalizationUtility;

use function array_key_exists;
use function count;
use function in_array;
use function strpos;

/**
Expand Down
48 changes: 45 additions & 3 deletions Classes/Controller/ToolsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,22 @@
use In2code\In2publishCore\Communication\RemoteProcedureCall\Letterbox;
use In2code\In2publishCore\Config\ConfigContainer;
use In2code\In2publishCore\Config\PostProcessor\DynamicValueProvider\DynamicValueProviderRegistry;
use In2code\In2publishCore\Domain\Service\ForeignSiteFinder;
use In2code\In2publishCore\Domain\Service\TcaProcessingService;
use In2code\In2publishCore\In2publishCoreException;
use In2code\In2publishCore\Service\Environment\EnvironmentService;
use In2code\In2publishCore\Testing\Service\TestingService;
use In2code\In2publishCore\Testing\Tests\TestResult;
use In2code\In2publishCore\Tools\ToolsRegistry;
use In2code\In2publishCore\Utility\DatabaseUtility;
use ReflectionProperty;
use Throwable;
use TYPO3\CMS\Core\Configuration\ExtensionConfiguration;
use TYPO3\CMS\Core\Core\Environment;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Messaging\AbstractMessage;
use TYPO3\CMS\Core\Registry;
use TYPO3\CMS\Core\Site\Entity\Site;
use TYPO3\CMS\Core\Site\SiteFinder;
use TYPO3\CMS\Core\Utility\ArrayUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Utility\VersionNumberUtility;
Expand All @@ -63,8 +65,6 @@
use function defined;
use function file_get_contents;
use function flush;
use function generateUpToDateMimeArray;
use function get_class;
use function gmdate;
use function header;
use function implode;
Expand Down Expand Up @@ -451,6 +451,47 @@ protected function getFullInfo(): array

$dynamicProvider = GeneralUtility::makeInstance(DynamicValueProviderRegistry::class)->getRegisteredClasses();

$siteConfigs = [];

$localSites = GeneralUtility::makeInstance(SiteFinder::class)->getAllSites(false);
$foreignSites = GeneralUtility::makeInstance(ForeignSiteFinder::class)->getAllSites();
/**
* @var string $side
* @var Site $site
*/
foreach (['local' => $localSites, 'foreign' => $foreignSites] as $side => $sites) {
foreach ($sites as $site) {
$langs = [];
$rootPageId = $site->getRootPageId();
foreach ($site->getAllLanguages() as $language) {
$languageId = $language->getLanguageId();
try {
$uri = $site->getRouter()->generateUri($rootPageId, ['_language' => $languageId])->__toString();
} catch (Throwable $throwable) {
$uri = (string)$throwable;
}
$langs[] = [
'base' => $language->getBase()->__toString(),
'actualURI' => $uri,
'langId' => $languageId,
'typo3Lang' => $language->getTypo3Language(),
'isocode' => $language->getTwoLetterIsoCode(),
];
}
try {
$uri = $site->getRouter()->generateUri($rootPageId)->__toString();
} catch (Throwable $throwable) {
$uri = (string)$throwable;
}
$siteConfigs[$side][$site->getIdentifier()] = [
'rootPageId' => $rootPageId,
'base' => $site->getBase()->__toString(),
'actualURI' => $uri,
'langs' => $langs,
];
}
}

return [
'TYPO3 Version' => VersionNumberUtility::getCurrentTypo3Version(),
'PHP Version' => PHP_VERSION,
Expand All @@ -471,6 +512,7 @@ protected function getFullInfo(): array
'personal config' => $pers,
'TCA' => $GLOBALS['TCA'],
'schema' => $schema,
'sites' => $siteConfigs,
];
}
}
9 changes: 1 addition & 8 deletions Classes/Domain/Factory/RecordFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -544,14 +544,6 @@ protected function isLooping($instanceTableName, $mergedIdentifier): bool
if (!empty($this->instantiationQueue[$instanceTableName])
&& in_array($mergedIdentifier, $this->instantiationQueue[$instanceTableName])
) {
$this->logger->info(
'Recursion detected! This is mostly a sys_file_reference'
. ' pointing to it\'s sys_file, which gets currently enriched',
[
'instanceTableName' => $instanceTableName,
'mergedIdentifier' => $mergedIdentifier,
]
);
return true;
}
if (empty($this->instantiationQueue[$instanceTableName])) {
Expand Down Expand Up @@ -665,6 +657,7 @@ protected function findTranslations(RecordInterface $record, CommonRepository $c
$tableName
);
foreach ($translatedRecords as $translatedRecord) {
$translatedRecord->setParentRecord($record);
$record->addTranslatedRecord($translatedRecord);
}
}
Expand Down
1 change: 0 additions & 1 deletion Classes/Domain/Model/Record.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
use In2code\In2publishCore\Service\Permission\PermissionService;
use LogicException;
use TYPO3\CMS\Core\Utility\GeneralUtility;

use TYPO3\CMS\Extbase\SignalSlot\Dispatcher;

use function array_diff;
Expand Down
7 changes: 5 additions & 2 deletions Classes/Domain/PostProcessing/FalIndexPostProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,10 @@ public function __construct()
*/
public function registerInstance(RecordFactory $recordFactory, RecordInterface $instance)
{
if ('sys_file' === $instance->getTableName()) {
if (
'sys_file' === $instance->getTableName()
&& ($instance->localRecordExists() || $instance->foreignRecordExists())
) {
$this->registeredInstances[$instance->getIdentifier()] = $instance;
}
}
Expand Down Expand Up @@ -143,7 +146,7 @@ public function postProcess(RecordFactory $recordFactory, RecordInterface $insta
*
* @return ResourceStorage
*/
protected function getStorage(RecordInterface $record): ResourceStorage
protected function getStorage(RecordInterface $record): ?ResourceStorage
{
static $storages = [];
if (!isset($storages[0])) {
Expand Down
5 changes: 4 additions & 1 deletion Classes/Domain/PostProcessing/FileIndexPostProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ public function __construct()
*/
public function registerInstance(RecordFactory $recordFactory, RecordInterface $instance)
{
if ('sys_file' === $instance->getTableName()) {
if (
'sys_file' === $instance->getTableName()
&& ($instance->localRecordExists() || $instance->foreignRecordExists())
) {
$this->registeredInstances[] = $instance;
}
}
Expand Down
Loading

0 comments on commit a2859dc

Please sign in to comment.