Commit 8a5f0306d0958ef9a6e0f601fa71b5dc310a6a23
1 parent
308dbdec
KTS-3456
"Allow indexing to not be dependant on open office" Fixed. When catdoc fails and OO must stand in, OO returns a new file containing the text. Committed By: Conrad Vermeulen Reviewed By: Megan Watson git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@9075 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
11 additions
and
1 deletions
search2/indexing/extractorCore.inc.php
| ... | ... | @@ -340,6 +340,7 @@ abstract class DocumentExtractor |
| 340 | 340 | abstract class ExternalDocumentExtractor extends DocumentExtractor |
| 341 | 341 | { |
| 342 | 342 | protected $allowOutput = false; |
| 343 | + protected $pipeStdoutToDevNull = false; | |
| 343 | 344 | |
| 344 | 345 | /** |
| 345 | 346 | * Initialise the extractor. |
| ... | ... | @@ -396,7 +397,15 @@ abstract class ExternalDocumentExtractor extends DocumentExtractor |
| 396 | 397 | |
| 397 | 398 | $script = "#!/bin/sh\n"; |
| 398 | 399 | $script .= "# This is an auto generated file. \n"; |
| 399 | - $script .= $cmd . ' 2>>"' . $script_out . "\" >/dev/null\n"; | |
| 400 | + $script .= $cmd . ' 2>>"' . $script_out . "\""; | |
| 401 | + | |
| 402 | + if ($this->pipeStdoutToDevNull) | |
| 403 | + { | |
| 404 | + $script .= " >/dev/null"; | |
| 405 | + } | |
| 406 | + | |
| 407 | + $script .= "\n"; | |
| 408 | + | |
| 400 | 409 | $script .= "exit $?\n"; |
| 401 | 410 | } |
| 402 | 411 | |
| ... | ... | @@ -552,6 +561,7 @@ abstract class OOFallbackDocumentExtractor extends ExternalDocumentExtractor |
| 552 | 561 | |
| 553 | 562 | $this->setIndexingStatus($this->oo->getIndexingStatus()); |
| 554 | 563 | $this->setExtractionStatus($this->oo->getExtractionStatus()); |
| 564 | + $this->setTargetFile($this->oo->getTargetFile()); | |
| 555 | 565 | |
| 556 | 566 | return $result; |
| 557 | 567 | } | ... | ... |