‪TYPO3CMS  9.5
TYPO3\CMS\Lowlevel\Command\RteImagesCommand Class Reference
Inheritance diagram for TYPO3\CMS\Lowlevel\Command\RteImagesCommand:

Public Member Functions

 configure ()
 

Protected Member Functions

 execute (InputInterface $input, OutputInterface $output)
 
 updateReferenceIndex (InputInterface $input, SymfonyStyle $io)
 
array findAllReferencedRteImagesWithOriginals ()
 
array findAllRteFilesInDirectory ($folder='uploads/')
 
 deleteLostFiles (array $lostFiles, bool $dryRun, SymfonyStyle $io)
 
 copyMultipleReferencedRteImages (array $multipleReferencedImages, bool $dryRun, SymfonyStyle $io)
 
string formatReferenceIndexEntryToString (array $record)
 

Detailed Description

Looking up all occurencies of RTEmagic images in the database and check existence of parent and copy files on the file system plus report possibly lost files of this type

Definition at line 35 of file RteImagesCommand.php.

Member Function Documentation

◆ configure()

TYPO3\CMS\Lowlevel\Command\RteImagesCommand::configure ( )

Configure the command by defining the name, options and arguments

Definition at line 41 of file RteImagesCommand.php.

◆ copyMultipleReferencedRteImages()

TYPO3\CMS\Lowlevel\Command\RteImagesCommand::copyMultipleReferencedRteImages ( array  $multipleReferencedImages,
bool  $dryRun,
SymfonyStyle  $io 
)
protected

Duplicate RTEmagic image files which are used on several records. RTEmagic images should be used by only one record at a time. A large amount of such images probably stems from previous versions of TYPO3 (before 4.2) which did not support making copies automatically of RTEmagic images in case of new copies / versions.

Parameters
array$multipleReferencedImages
bool$dryRun
SymfonyStyle$io

Definition at line 317 of file RteImagesCommand.php.

References TYPO3\CMS\Core\Utility\PathUtility\basenameDuringBootstrap(), TYPO3\CMS\Core\Utility\PathUtility\dirnameDuringBootstrap(), TYPO3\CMS\Core\Core\Environment\getPublicPath(), and TYPO3\CMS\Core\Utility\PathUtility\stripPathSitePrefix().

Referenced by TYPO3\CMS\Lowlevel\Command\RteImagesCommand\execute().

◆ deleteLostFiles()

TYPO3\CMS\Lowlevel\Command\RteImagesCommand::deleteLostFiles ( array  $lostFiles,
bool  $dryRun,
SymfonyStyle  $io 
)
protected

Removes given files from the uploads/ folder

Parameters
array$lostFiles‪Contains the lost files found
bool$dryRun‪if set, the files are just displayed, but not deleted
SymfonyStyle$io‪the IO object for output

Definition at line 288 of file RteImagesCommand.php.

Referenced by TYPO3\CMS\Lowlevel\Command\RteImagesCommand\execute().

◆ execute()

TYPO3\CMS\Lowlevel\Command\RteImagesCommand::execute ( InputInterface  $input,
OutputInterface  $output 
)
protected

Executes the command to

  • ‪optionally update the reference index (to have clean data)
  • ‪find files within uploads/* which are not connected to the reference index
  • ‪remove these files if –dry-run is not set
Parameters
InputInterface$input
OutputInterface$output

Definition at line 89 of file RteImagesCommand.php.

References $output, TYPO3\CMS\Lowlevel\Command\RteImagesCommand\copyMultipleReferencedRteImages(), TYPO3\CMS\Lowlevel\Command\RteImagesCommand\deleteLostFiles(), TYPO3\CMS\Lowlevel\Command\RteImagesCommand\findAllReferencedRteImagesWithOriginals(), TYPO3\CMS\Lowlevel\Command\RteImagesCommand\findAllRteFilesInDirectory(), TYPO3\CMS\Core\Core\Bootstrap\initializeBackendAuthentication(), and TYPO3\CMS\Lowlevel\Command\RteImagesCommand\updateReferenceIndex().

◆ findAllReferencedRteImagesWithOriginals()

array TYPO3\CMS\Lowlevel\Command\RteImagesCommand::findAllReferencedRteImagesWithOriginals ( )
protected

◆ findAllRteFilesInDirectory()

array TYPO3\CMS\Lowlevel\Command\RteImagesCommand::findAllRteFilesInDirectory (   $folder = 'uploads/')
protected

Find all RTE files in uploads/ folder

Parameters
string$folder‪the name of the folder to start from
Returns
‪array an array of files (relative to Environment::getPublicPath()) that are not connected

Definition at line 260 of file RteImagesCommand.php.

References TYPO3\CMS\Core\Utility\PathUtility\basenameDuringBootstrap(), and TYPO3\CMS\Core\Core\Environment\getPublicPath().

Referenced by TYPO3\CMS\Lowlevel\Command\RteImagesCommand\execute().

◆ formatReferenceIndexEntryToString()

string TYPO3\CMS\Lowlevel\Command\RteImagesCommand::formatReferenceIndexEntryToString ( array  $record)
protected

Formats a sys_refindex entry to something readable

Parameters
array$record
Returns
‪string

Definition at line 373 of file RteImagesCommand.php.

Referenced by TYPO3\CMS\Lowlevel\Command\RteImagesCommand\findAllReferencedRteImagesWithOriginals().

◆ updateReferenceIndex()

TYPO3\CMS\Lowlevel\Command\RteImagesCommand::updateReferenceIndex ( InputInterface  $input,
SymfonyStyle  $io 
)
protected

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
Parameters
InputInterface$input‪holds information about entered parameters
SymfonyStyle$io‪necessary for outputting information

Definition at line 176 of file RteImagesCommand.php.

Referenced by TYPO3\CMS\Lowlevel\Command\RteImagesCommand\execute().