Commit 9c84b55c864fc297918fa5aa409ba69a0a36879c

Authored by kevin_fourie
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
bin/win32/installScheduler.php 0 → 100644
  1 +<?php
  2 +
  3 +$dir = realpath(dirname(__FILE__) . '/schedulerService.php');
  4 +
  5 +win32_create_service(array(
  6 + 'service' => 'ktscheduler',
  7 + 'display' => 'KnowledgeTree Scheduler Service',
  8 + 'params' => $dir
  9 + ));
  10 +
  11 +?>
0 12 \ No newline at end of file
... ...
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 23 \ No newline at end of file
... ...
bin/win32/schedulerServiceStatus.php 0 → 100644
  1 +<?php
  2 +
  3 +var_dump(win32_query_service_status('ktscheduler'));
  4 +
  5 +?>
0 6 \ No newline at end of file
... ...
bin/win32/uninstallScheduler.php 0 → 100644
  1 +<?php
  2 +
  3 +win32_delete_service('ktscheduler');
  4 +
  5 +?>
0 6 \ No newline at end of file
... ...
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 51 \ No newline at end of file
... ...
search2/indexing/extractors/PSExtractor.inc.php
... ... @@ -9,8 +9,22 @@ class PSExtractor extends ApplicationExtractor
9 9  
10 10 public function getSupportedMimeTypes()
11 11 {
  12 + if (OS_WINDOWS)
  13 + {
  14 + return array();
  15 + }
12 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 31 \ No newline at end of file
... ...