Commit 93d599ea4cea6f8d2f2238d2a392d2b73571b3e7

Authored by conradverm
1 parent 98fcf4b8

KTS-2584

"Postscrip extractor is disabled on linux"
Fixed. The issue was that the full path to the application was not used and that the parameters were incorrect.

Committed By: Conrad Vermeulen
Reviewed By: Megan Watson

git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@7588 c91229c3-7414-0410-bfa2-8a42b809f60b
search2/indexing/extractorCore.inc.php
... ... @@ -456,7 +456,7 @@ abstract class ApplicationExtractor extends ExternalDocumentExtractor
456 456 {
457 457 $sources = array('{source}','{target}');
458 458 $target = array($this->sourcefile, $this->targetfile);
459   - $cmdline = $this->command . ' ' . str_replace($sources,$target, $this->params);
  459 + $cmdline = $this->application . ' ' . str_replace($sources,$target, $this->params);
460 460  
461 461 return $cmdline;
462 462 }
... ...
search2/indexing/extractors/PDFExtractor.inc.php
... ... @@ -40,7 +40,10 @@ class PDFExtractor extends ApplicationExtractor
40 40 {
41 41 public function __construct()
42 42 {
43   - parent::__construct('externalBinary','pdftotext','pdftotext',_kt('PDF Text Extractor'),'-nopgbrk -enc UTF-8 \'{source}\' \'{target}\'');
  43 + $config = KTConfig::getSingleton();
  44 + $params = $config->get('extractorParameters/pdftotext', '-nopgbrk -enc UTF-8 \'{source}\' \'{target}\'');
  45 +
  46 + parent::__construct('externalBinary','pdftotext','pdftotext',_kt('PDF Text Extractor'),$params);
44 47 }
45 48  
46 49 public function getSupportedMimeTypes()
... ...
search2/indexing/extractors/PSExtractor.inc.php
... ... @@ -40,7 +40,10 @@ class PSExtractor extends ApplicationExtractor
40 40 {
41 41 public function __construct()
42 42 {
43   - parent::__construct('externalBinary','pstotext','pstotext',_kt('PostScript Text Extractor'),'-nopgbrk -enc UTF-8 {source} {target}');
  43 + $config = KTConfig::getSingleton();
  44 + $params = $config->get('extractorParameters/pstotext', '\'{source}\' > \'{target}\'');
  45 +
  46 + parent::__construct('externalBinary','pstotext','pstotext',_kt('PostScript Text Extractor'), $params);
44 47 }
45 48  
46 49 public function getSupportedMimeTypes()
... ... @@ -56,6 +59,7 @@ class PSExtractor extends ApplicationExtractor
56 59 {
57 60 if (OS_WINDOWS)
58 61 {
  62 + // pstotext is not available under windows, so no need to diagnose it
59 63 return null;
60 64 }
61 65 return parent::diagnose();
... ...