Commit 9c84b55c864fc297918fa5aa409ba69a0a36879c
1 parent
61bacbae
Merged in from DEV trunk...
KTS-2525 "Create windows service to wrap around scheduler" Implemented. Committed By: Conrad Vermeulen Reviewed By: Kevin Fourie KTS-673 "The search algorithm needs some work" Updated. Added Exif extractor Committed By: Conrad Vermeulen Reviewed By: Kevin Fourie KTS-673 "The search algorithm needs some work" Updated. pstotext only available in windows Committed By: Conrad Vermeulen Reviewed By: Kevin Fourie git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/STABLE/trunk@7437 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
6 changed files
with
107 additions
and
0 deletions
bin/win32/installScheduler.php
0 → 100644
bin/win32/schedulerService.php
0 → 100644
| 1 | +<?php | ||
| 2 | + | ||
| 3 | + | ||
| 4 | +$dir = realpath(dirname(__FILE__) . '/..'); | ||
| 5 | +chdir($dir); | ||
| 6 | + | ||
| 7 | +$phpPath = realpath('../../../php/php.exe'); | ||
| 8 | +if (!is_file($phpPath)) | ||
| 9 | +{ | ||
| 10 | + die('Cannot find php.exe'); | ||
| 11 | +} | ||
| 12 | + | ||
| 13 | + | ||
| 14 | + win32_start_service_ctrl_dispatcher('ktscheduler'); | ||
| 15 | + | ||
| 16 | + while (WIN32_SERVICE_CONTROL_STOP != win32_get_last_control_message()) | ||
| 17 | + { | ||
| 18 | + system("$phpPath scheduler.php"); | ||
| 19 | + sleep(60); | ||
| 20 | + } | ||
| 21 | + | ||
| 22 | +?> | ||
| 0 | \ No newline at end of file | 23 | \ No newline at end of file |
bin/win32/schedulerServiceStatus.php
0 → 100644
bin/win32/uninstallScheduler.php
0 → 100644
search2/indexing/extractors/ExifExtractor.inc.php
0 → 100644
| 1 | +<?php | ||
| 2 | + | ||
| 3 | +class ExifExtractor extends DocumentExtractor | ||
| 4 | +{ | ||
| 5 | + public function getDisplayName() | ||
| 6 | + { | ||
| 7 | + return _kt('Exif Extractor'); | ||
| 8 | + } | ||
| 9 | + | ||
| 10 | + public function getSupportedMimeTypes() | ||
| 11 | + { | ||
| 12 | + return array( | ||
| 13 | + 'image/tiff','image/jpeg' | ||
| 14 | + ); | ||
| 15 | + } | ||
| 16 | + | ||
| 17 | + public function extractTextContent() | ||
| 18 | + { | ||
| 19 | + $exif = exif_read_data($this->sourcefile, 0, true); | ||
| 20 | + $content = ''; | ||
| 21 | + foreach ($exif as $key => $section) | ||
| 22 | + { | ||
| 23 | + foreach ($section as $name => $val) | ||
| 24 | + { | ||
| 25 | + if (is_numeric($val)) | ||
| 26 | + { | ||
| 27 | + // no point indexing numeric content. it will be ignored anyways! | ||
| 28 | + continue; | ||
| 29 | + } | ||
| 30 | + $content .= "$val\n"; | ||
| 31 | + } | ||
| 32 | + } | ||
| 33 | + | ||
| 34 | + $result = file_put_contents($this->targetfile, $content); | ||
| 35 | + | ||
| 36 | + return false !== $result; | ||
| 37 | + } | ||
| 38 | + | ||
| 39 | + public function diagnose() | ||
| 40 | + { | ||
| 41 | + if (!function_exists('exif_read_data')) | ||
| 42 | + { | ||
| 43 | + return sprintf(_kt('The Exif extractor requires the module exif php extension. Please include this in the php.ini.')); | ||
| 44 | + } | ||
| 45 | + | ||
| 46 | + return null; | ||
| 47 | + } | ||
| 48 | +} | ||
| 49 | + | ||
| 50 | +?> | ||
| 0 | \ No newline at end of file | 51 | \ No newline at end of file |
search2/indexing/extractors/PSExtractor.inc.php
| @@ -9,8 +9,22 @@ class PSExtractor extends ApplicationExtractor | @@ -9,8 +9,22 @@ class PSExtractor extends ApplicationExtractor | ||
| 9 | 9 | ||
| 10 | public function getSupportedMimeTypes() | 10 | public function getSupportedMimeTypes() |
| 11 | { | 11 | { |
| 12 | + if (OS_WINDOWS) | ||
| 13 | + { | ||
| 14 | + return array(); | ||
| 15 | + } | ||
| 12 | return array('application/postscript'); | 16 | return array('application/postscript'); |
| 13 | } | 17 | } |
| 18 | + | ||
| 19 | + public function diagnose() | ||
| 20 | + { | ||
| 21 | + if (OS_WINDOWS) | ||
| 22 | + { | ||
| 23 | + return null; | ||
| 24 | + } | ||
| 25 | + return parent::diagnose(); | ||
| 26 | + } | ||
| 27 | + | ||
| 14 | } | 28 | } |
| 15 | 29 | ||
| 16 | ?> | 30 | ?> |
| 17 | \ No newline at end of file | 31 | \ No newline at end of file |