MissingFilesCommand extends Command
Finds files which are referenced by TYPO3 but not found in the file system
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 actual file does not exist (anymore) - remove these files if --dry-run is not set (not possible for refindexes)
- findMissingReferencedFiles() : array<string|int, mixed>
- Find file references that points to non-existing files in system Fix methods: API in \TYPO3\CMS\Core\Database\ReferenceIndex that allows to change the value of a reference (or remove it)
- findMissingSoftReferencedFiles() : array<string|int, mixed>
- Find file references that points to non-existing files in system registered as soft references (checked for "softref_key")
- formatReferenceIndexEntryToString() : string
- Formats a sys_refindex entry to something readable
- getFileNameWithoutAnchor() : string
- Remove a possible anchor like 'my-path/file.pdf#page15'
- removeReferencesToMissingFiles() : mixed
- Removes all references in the sys_file_reference where files were not found
- updateReferenceIndex() : mixed
- 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
__construct()
public
__construct(ConnectionPool $connectionPool) : mixed
Parameters
- $connectionPool : ConnectionPool
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 actual file does not exist (anymore) - 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
intfindMissingReferencedFiles()
Find file references that points to non-existing files in system Fix methods: API in \TYPO3\CMS\Core\Database\ReferenceIndex that allows to change the value of a reference (or remove it)
protected
findMissingReferencedFiles() : array<string|int, mixed>
Return values
array<string|int, mixed> —an array of records within sys_refindex
findMissingSoftReferencedFiles()
Find file references that points to non-existing files in system registered as soft references (checked for "softref_key")
protected
findMissingSoftReferencedFiles() : array<string|int, mixed>
Return values
array<string|int, mixed> —an array of the data within soft references
formatReferenceIndexEntryToString()
Formats a sys_refindex entry to something readable
protected
formatReferenceIndexEntryToString(array<string|int, mixed> $record) : string
Parameters
- $record : array<string|int, mixed>
Return values
stringgetFileNameWithoutAnchor()
Remove a possible anchor like 'my-path/file.pdf#page15'
protected
getFileNameWithoutAnchor(string $fileName) : string
Parameters
- $fileName : string
-
a filename as found in sys_refindex.ref_string
Return values
string —the filename but leaving everything behind #page15 behind
removeReferencesToMissingFiles()
Removes all references in the sys_file_reference where files were not found
protected
removeReferencesToMissingFiles(array<string|int, mixed> $missingManagedFiles, bool $dryRun, SymfonyStyle $io) : mixed
Parameters
- $missingManagedFiles : array<string|int, mixed>
-
Contains the records of sys_refindex which need to be updated
- $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) : mixed
Parameters
- $input : InputInterface
-
holds information about entered parameters
- $io : SymfonyStyle
-
necessary for outputting information