public function TextExtractorPluginBase::extract in Search API attachments 9.0.x
Same name and namespace in other branches
- 8 src/TextExtractorPluginBase.php \Drupal\search_api_attachments\TextExtractorPluginBase::extract()
Extract method.
Parameters
\Drupal\file\Entity\File $file: The file object.
Return value
string The file extracted content.
Overrides TextExtractorPluginInterface::extract
6 methods override TextExtractorPluginBase::extract()
- DocconvExtractor::extract in src/
Plugin/ search_api_attachments/ DocconvExtractor.php - Extract method.
- PdftotextExtractor::extract in src/
Plugin/ search_api_attachments/ PdftotextExtractor.php - Extract file with Pdftotext command line tool.
- PythonPdf2txtExtractor::extract in src/
Plugin/ search_api_attachments/ PythonPdf2txtExtractor.php - Extract file with python Pdf2txt library.
- SolrExtractor::extract in src/
Plugin/ search_api_attachments/ SolrExtractor.php - Extract file with a search api solr backend.
- TikaExtractor::extract in src/
Plugin/ search_api_attachments/ TikaExtractor.php - Extract file with Tika library.
File
- src/
TextExtractorPluginBase.php, line 80
Class
- TextExtractorPluginBase
- Base class for plugins able to extract file content.
Namespace
Drupal\search_api_attachmentsCode
public function extract(File $file) {
$filename = $file;
$mode = 'r';
return fopen($filename, $mode);
}