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

Public Member Functions

 configure ()
 

Protected Member Functions

 execute (InputInterface $input, OutputInterface $output)
 
 updateReferenceIndex (InputInterface $input, SymfonyStyle $io)
 
array findLostFiles ($excludedPaths=[], $customPaths='')
 
 deleteLostFiles (array $lostFiles, bool $dryRun, SymfonyStyle $io)
 

Detailed Description

Finds files within uploads/ which are not needed anymore

Definition at line 33 of file LostFilesCommand.php.

Member Function Documentation

◆ configure()

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

Configure the command by defining the name, options and arguments

Definition at line 39 of file LostFilesCommand.php.

◆ deleteLostFiles()

TYPO3\CMS\Lowlevel\Command\LostFilesCommand::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 262 of file LostFilesCommand.php.

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

◆ execute()

TYPO3\CMS\Lowlevel\Command\LostFilesCommand::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 95 of file LostFilesCommand.php.

References $output, TYPO3\CMS\Lowlevel\Command\LostFilesCommand\deleteLostFiles(), TYPO3\CMS\Lowlevel\Command\LostFilesCommand\findLostFiles(), TYPO3\CMS\Core\Core\Bootstrap\initializeBackendAuthentication(), and TYPO3\CMS\Lowlevel\Command\LostFilesCommand\updateReferenceIndex().

◆ findLostFiles()

array TYPO3\CMS\Lowlevel\Command\LostFilesCommand::findLostFiles (   $excludedPaths = [],
  $customPaths = '' 
)
protected

Find lost files in uploads/ or custom folder

Parameters
array$excludedPaths‪list of paths to be excluded, can be uploads/pics/
string$customPaths‪list of paths to be checked instead of uploads/
Returns
‪array an array of files (relative to Environment::getPublicPath()) that are not connected

Definition at line 175 of file LostFilesCommand.php.

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

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

◆ updateReferenceIndex()

TYPO3\CMS\Lowlevel\Command\LostFilesCommand::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 148 of file LostFilesCommand.php.

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