TextExtractorRegistry implements SingletonInterface
Registry for text extractors, which are registered as tagged services via the #[AsTextExtractor] attribute or the 'fal.text_extractor' service tag. Extractors are ordered by their tag priority, an extractor with a higher priority is asked first whether it can extract text from a file.
Table of Contents
Interfaces
- SingletonInterface
- "empty" interface for singletons (marker interface pattern)
Properties
- $instances : array<string|int, TextExtractorInterface>|null
- Instance cache for text extractor classes
- $textExtractors : iterable<string|int, mixed>
Methods
- __construct() : mixed
- getTextExtractor() : TextExtractorInterface|null
- Checks whether any registered text extractor can deal with a given file and returns it.
- registerTextExtractor() : void
- getTextExtractorInstances() : array<string|int, TextExtractorInterface>
- Get all registered text extractor instances
Properties
$instances
Instance cache for text extractor classes
protected
array<string|int, TextExtractorInterface>|null
$instances
= null
$textExtractors read-only
protected
iterable<string|int, mixed>
$textExtractors
= []
Methods
__construct()
public
__construct([iterable<string|int, TextExtractorInterface> $textExtractors = [] ]) : mixed
Parameters
- $textExtractors : iterable<string|int, TextExtractorInterface> = []
getTextExtractor()
Checks whether any registered text extractor can deal with a given file and returns it.
public
getTextExtractor(FileInterface $file) : TextExtractorInterface|null
Parameters
- $file : FileInterface
Return values
TextExtractorInterface|nullregisterTextExtractor()
public
registerTextExtractor(string $className) : void
since TYPO3 v15.0, this method is a no-op and will be removed in TYPO3 v16.0. Register the text extractor as a tagged service using the #[AsTextExtractor] attribute instead.
Parameters
- $className : string
getTextExtractorInstances()
Get all registered text extractor instances
protected
getTextExtractorInstances() : array<string|int, TextExtractorInterface>