|
@@ 712-729 (lines=18) @@
|
| 709 |
|
* |
| 710 |
|
* @throws NotPermittedException |
| 711 |
|
*/ |
| 712 |
|
private function extractContentFromFilePDF(FilesDocument $document, File $file) { |
| 713 |
|
if ($this->parseMimeType($document->getMimeType()) !== self::MIMETYPE_PDF) { |
| 714 |
|
return; |
| 715 |
|
} |
| 716 |
|
|
| 717 |
|
$this->configService->setDocumentIndexOption($document, ConfigService::FILES_PDF); |
| 718 |
|
if (!$this->isSourceIndexable($document)) { |
| 719 |
|
return; |
| 720 |
|
} |
| 721 |
|
|
| 722 |
|
if ($this->configService->getAppValue(ConfigService::FILES_PDF) !== '1') { |
| 723 |
|
$document->setContent(''); |
| 724 |
|
|
| 725 |
|
return; |
| 726 |
|
} |
| 727 |
|
|
| 728 |
|
$document->setContent( |
| 729 |
|
base64_encode($file->getContent()), IndexDocument::ENCODED_BASE64 |
| 730 |
|
); |
| 731 |
|
} |
| 732 |
|
|
|
@@ 740-757 (lines=18) @@
|
| 737 |
|
* |
| 738 |
|
* @throws NotPermittedException |
| 739 |
|
*/ |
| 740 |
|
private function extractContentFromFileOffice(FilesDocument $document, File $file) { |
| 741 |
|
if ($this->parseMimeType($document->getMimeType()) !== self::MIMETYPE_OFFICE) { |
| 742 |
|
return; |
| 743 |
|
} |
| 744 |
|
|
| 745 |
|
$this->configService->setDocumentIndexOption($document, ConfigService::FILES_OFFICE); |
| 746 |
|
if (!$this->isSourceIndexable($document)) { |
| 747 |
|
return; |
| 748 |
|
} |
| 749 |
|
|
| 750 |
|
if ($this->configService->getAppValue(ConfigService::FILES_OFFICE) !== '1') { |
| 751 |
|
$document->setContent(''); |
| 752 |
|
|
| 753 |
|
return; |
| 754 |
|
} |
| 755 |
|
|
| 756 |
|
$document->setContent( |
| 757 |
|
base64_encode($file->getContent()), IndexDocument::ENCODED_BASE64 |
| 758 |
|
); |
| 759 |
|
} |
| 760 |
|
|