MissingRelationsCommand

class \TYPO3\CMS\Lowlevel\Command\MissingRelationsCommand

Extends
Command

Finds references and soft-references to - records which are marked as deleted (e.g. still in the system as reminder) - offline versions (references should never point to offline versions) - non-existing records (records which have been deleted not via DataHandler)

The later (non-soft-reference variants) can be automatically fixed by simply removing the references from the refindex.

Table of Contents

Methods

__construct()  : mixed
configure()  : mixed
Configure the command by defining the name, options and arguments
execute()  : int
Executes the command to - optionally update the reference index (to have clean data) - find data in sys_refindex (softrefs and regular references) where the reference points to a non-existing record or offline version - remove these files if --dry-run is not set (not possible for refindexes)
findRelationsToNonExistingRecords()  : array
Find relations pointing to non-existing records (in managed references or soft-references)
formatReferenceIndexEntryToString()  : string
Formats a sys_refindex entry to something readable
removeReference()  : void
Remove a reference to a missing record
removeReferencesToMissingRecords()  : void
Removes all references to non-existing records or offline versions
updateReferenceIndex()  : void
Function to update the reference index - if the option --update-refindex is set, do it - otherwise, if in interactive mode (not having -n set), ask the user - otherwise assume everything is fine

Methods

configure()

Configure the command by defining the name, options and arguments

public configure() : mixed

execute()

Executes the command to - optionally update the reference index (to have clean data) - find data in sys_refindex (softrefs and regular references) where the reference points to a non-existing record or offline version - remove these files if --dry-run is not set (not possible for refindexes)

protected execute(InputInterface $input, OutputInterface $output) : int

Parameters

$input : InputInterface
$output : OutputInterface

Return values

int

findRelationsToNonExistingRecords()

Find relations pointing to non-existing records (in managed references or soft-references)

protected findRelationsToNonExistingRecords() : array

Return values

array

formatReferenceIndexEntryToString()

Formats a sys_refindex entry to something readable

protected formatReferenceIndexEntryToString(array $record) : string

Parameters

$record : array

Return values

string

removeReference()

Remove a reference to a missing record

protected removeReference(string $hash, string $recordReference, bool $dryRun, SymfonyStyle $io) : void

Parameters

$hash : string
$recordReference : string
$dryRun : bool
$io : SymfonyStyle

removeReferencesToMissingRecords()

Removes all references to non-existing records or offline versions

protected removeReferencesToMissingRecords(array $offlineVersionRecords, array $nonExistingRecords, bool $dryRun, SymfonyStyle $io) : void

Parameters

$offlineVersionRecords : array

Contains the records of offline versions of sys_refindex which need to be removed

$nonExistingRecords : array

Contains the records non-existing records of sys_refindex which need to be removed

$dryRun : bool

if set, the references are just displayed, but not removed

$io : SymfonyStyle

the IO object for output

updateReferenceIndex()

Function to update the reference index - if the option --update-refindex is set, do it - otherwise, if in interactive mode (not having -n set), ask the user - otherwise assume everything is fine

protected updateReferenceIndex(InputInterface $input, SymfonyStyle $io) : void

Parameters

$input : InputInterface
$io : SymfonyStyle
On this page