TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
Indexer Class Reference

Public Member Functions

 __construct (ResourceStorage $storage)
 
 createIndexEntry ($identifier)
 
 updateIndexEntry (File $fileObject)
 
 processChangesInStorages ()
 
 runMetaDataExtraction ($maximumFileCount=-1)
 
 extractMetaData (File $fileObject)
 

Protected Member Functions

 getExtractionServices ()
 
 detectMissingFiles ()
 
 isFileTypeSupportedByExtractor (File $file, ExtractorInterface $extractor)
 
 detectChangedFilesInStorage (array $fileIdentifierArray)
 
 processChangedAndNewFiles ()
 
 extractRequiredMetaData (File $fileObject)
 
 gatherFileInformationArray ($identifier)
 
 getFileType ($mimeType)
 
 transformFromDriverFileInfoArrayToFileObjectFormat (array $fileInfo)
 
 getFileIndexRepository ()
 
 getMetaDataRepository ()
 
 getResourceFactory ()
 
 getExtractorRegistry ()
 

Protected Attributes

 $filesToUpdate = []
 
 $identifiedFileUids = []
 
 $storage = null
 
 $extractionServices = null
 

Detailed Description

The New FAL Indexer

Definition at line 27 of file core/Classes/Resource/Index/Indexer.php.

Constructor & Destructor Documentation

__construct ( ResourceStorage  $storage)
Parameters
ResourceStorage$storage

Definition at line 52 of file core/Classes/Resource/Index/Indexer.php.

References Indexer\$storage.

Member Function Documentation

createIndexEntry (   $identifier)

Create index entry

Parameters
string$identifier
Returns
File
Exceptions
InvalidArgumentException

Definition at line 64 of file core/Classes/Resource/Index/Indexer.php.

References Indexer\extractRequiredMetaData(), Indexer\gatherFileInformationArray(), Indexer\getFileIndexRepository(), and Indexer\getResourceFactory().

Referenced by Indexer\processChangedAndNewFiles().

detectChangedFilesInStorage ( array  $fileIdentifierArray)
protected

Adds updated files to the processing queue

Parameters
array$fileIdentifierArray
Returns
void

Definition at line 201 of file core/Classes/Resource/Index/Indexer.php.

References Indexer\getFileIndexRepository().

Referenced by Indexer\processChangesInStorages().

detectMissingFiles ( )
protected

Since by now all files in filesystem have been looked at it is save to assume, that files that are in indexed but not touched in this run are missing

Definition at line 164 of file core/Classes/Resource/Index/Indexer.php.

References Indexer\getFileIndexRepository().

Referenced by Indexer\processChangesInStorages().

extractRequiredMetaData ( File  $fileObject)
protected

Since the core desperately needs image sizes in metadata table put them there This should be called after every "content" update and "record" creation

Parameters
File$fileObject

Definition at line 272 of file core/Classes/Resource/Index/Indexer.php.

References File\_updateMetaDataProperties(), AbstractFile\FILETYPE_IMAGE, AbstractFile\getForLocalProcessing(), Indexer\getMetaDataRepository(), AbstractFile\getType(), AbstractFile\getUid(), and GeneralUtility\makeInstance().

Referenced by Indexer\createIndexEntry(), and Indexer\updateIndexEntry().

gatherFileInformationArray (   $identifier)
protected

Collects the information to be cached in sys_file

Parameters
string$identifier
Returns
array

Definition at line 300 of file core/Classes/Resource/Index/Indexer.php.

References Indexer\getFileType(), PathUtility\pathinfo(), and Indexer\transformFromDriverFileInfoArrayToFileObjectFormat().

Referenced by Indexer\createIndexEntry(), and Indexer\updateIndexEntry().

getExtractionServices ( )
protected

Get available extraction services

Returns
ExtractorInterface[]

Definition at line 152 of file core/Classes/Resource/Index/Indexer.php.

References Indexer\$extractionServices, and Indexer\getExtractorRegistry().

Referenced by Indexer\extractMetaData().

getExtractorRegistry ( )
protected

Returns an instance of the FileIndexRepository

Returns
ExtractorRegistry

Definition at line 412 of file core/Classes/Resource/Index/Indexer.php.

References ExtractorRegistry\getInstance().

Referenced by Indexer\getExtractionServices().

getFileType (   $mimeType)
protected
getMetaDataRepository ( )
protected
isFileTypeSupportedByExtractor ( File  $file,
ExtractorInterface  $extractor 
)
protected

Check whether the extractor service supports this file according to file type restrictions.

Parameters
File$file
ExtractorInterface$extractor
Returns
bool

Definition at line 185 of file core/Classes/Resource/Index/Indexer.php.

References ExtractorInterface\getFileTypeRestrictions(), and AbstractFile\getType().

Referenced by Indexer\extractMetaData().

processChangedAndNewFiles ( )
protected

Processes the Files which have been detected as "changed or new" in the storage

Returns
void

Definition at line 231 of file core/Classes/Resource/Index/Indexer.php.

References Indexer\createIndexEntry(), Indexer\getFileIndexRepository(), Indexer\getResourceFactory(), and Indexer\updateIndexEntry().

Referenced by Indexer\processChangesInStorages().

runMetaDataExtraction (   $maximumFileCount = -1)
Parameters
int$maximumFileCount
Returns
void

Definition at line 107 of file core/Classes/Resource/Index/Indexer.php.

References Indexer\extractMetaData(), Indexer\getFileIndexRepository(), and Indexer\getResourceFactory().

transformFromDriverFileInfoArrayToFileObjectFormat ( array  $fileInfo)
protected

However it happened, the properties of a file object which are persisted to the database are named different than the properties the driver returns in getFileInfo. Therefore a mapping must happen.

Parameters
array$fileInfo
Returns
array

Definition at line 354 of file core/Classes/Resource/Index/Indexer.php.

Referenced by Indexer\gatherFileInformationArray().

updateIndexEntry ( File  $fileObject)

Member Data Documentation

$extractionServices = null
protected
$filesToUpdate = []
protected

Definition at line 32 of file core/Classes/Resource/Index/Indexer.php.

$identifiedFileUids = []
protected

Definition at line 37 of file core/Classes/Resource/Index/Indexer.php.

$storage = null
protected

Definition at line 42 of file core/Classes/Resource/Index/Indexer.php.

Referenced by Indexer\__construct().