From 86233ae3a80b0b1083321105bdcc5ca403598a95 Mon Sep 17 00:00:00 2001 From: nbm Date: Sun, 27 Nov 2005 21:34:24 +0000 Subject: [PATCH] Add a Microsoft Office (Powerpoint) presentation indexer --- plugins/ktstandard/contents/PowerpointIndexer.php | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+), 0 deletions(-) create mode 100644 plugins/ktstandard/contents/PowerpointIndexer.php diff --git a/plugins/ktstandard/contents/PowerpointIndexer.php b/plugins/ktstandard/contents/PowerpointIndexer.php new file mode 100644 index 0000000..6bf08b5 --- /dev/null +++ b/plugins/ktstandard/contents/PowerpointIndexer.php @@ -0,0 +1,30 @@ +oDocument = $oDocument; + } + + function transform() { + $oStorage = KTStorageManagerUtil::getSingleton(); + $sFile = $oStorage->temporaryFile($this->oDocument); + + $cmdline = array("catppt", $sFile); + $myfilename = tempnam("/tmp", "kt.catppt"); + $command = KTUtil::safeShellString($cmdline) . " >> " . $myfilename; + system($command); + $contents = file_get_contents($myfilename); + unlink($myfilename); + if (empty($contents)) { + return; + } + $aInsertValues = array( + 'document_id' => $this->oDocument->getId(), + 'document_text' => $contents, + ); + $sTable = KTUtil::getTableName('document_text'); + DBUtil::autoInsert($sTable, $aInsertValues, array('noid' => true)); + } +} + +?> -- libgit2 0.21.4