|
@@ 732-751 (lines=20) @@
|
| 729 |
|
* |
| 730 |
|
* @throws NotPermittedException |
| 731 |
|
*/ |
| 732 |
|
private function extractContentFromFilePDF(FilesDocument $document, File $file) { |
| 733 |
|
if ($this->parseMimeType($document->getMimeType()) !== self::MIMETYPE_PDF) { |
| 734 |
|
return; |
| 735 |
|
} |
| 736 |
|
|
| 737 |
|
$this->configService->setDocumentIndexOption($document, ConfigService::FILES_PDF); |
| 738 |
|
if (!$this->isSourceIndexable($document)) { |
| 739 |
|
return; |
| 740 |
|
} |
| 741 |
|
|
| 742 |
|
if ($this->configService->getAppValue(ConfigService::FILES_PDF) !== '1') { |
| 743 |
|
$document->setContent(''); |
| 744 |
|
|
| 745 |
|
return; |
| 746 |
|
} |
| 747 |
|
|
| 748 |
|
$document->setContent( |
| 749 |
|
base64_encode($file->getContent()), IndexDocument::ENCODED_BASE64 |
| 750 |
|
); |
| 751 |
|
} |
| 752 |
|
|
| 753 |
|
|
| 754 |
|
/** |
|
@@ 760-779 (lines=20) @@
|
| 757 |
|
* |
| 758 |
|
* @throws NotPermittedException |
| 759 |
|
*/ |
| 760 |
|
private function extractContentFromFileOffice(FilesDocument $document, File $file) { |
| 761 |
|
if ($this->parseMimeType($document->getMimeType()) !== self::MIMETYPE_OFFICE) { |
| 762 |
|
return; |
| 763 |
|
} |
| 764 |
|
|
| 765 |
|
$this->configService->setDocumentIndexOption($document, ConfigService::FILES_OFFICE); |
| 766 |
|
if (!$this->isSourceIndexable($document)) { |
| 767 |
|
return; |
| 768 |
|
} |
| 769 |
|
|
| 770 |
|
if ($this->configService->getAppValue(ConfigService::FILES_OFFICE) !== '1') { |
| 771 |
|
$document->setContent(''); |
| 772 |
|
|
| 773 |
|
return; |
| 774 |
|
} |
| 775 |
|
|
| 776 |
|
$document->setContent( |
| 777 |
|
base64_encode($file->getContent()), IndexDocument::ENCODED_BASE64 |
| 778 |
|
); |
| 779 |
|
} |
| 780 |
|
|
| 781 |
|
|
| 782 |
|
/** |