new version, catch exception in execWithTimeout()

This commit is contained in:
Uwe Steinmann 2017-03-01 15:56:00 +01:00
parent 112aab5a4c
commit 77eab44dc1
2 changed files with 27 additions and 18 deletions

View File

@ -127,19 +127,12 @@ class SeedDMS_Lucene_IndexedDocument extends Zend_Search_Lucene_Document {
$mimetype = $version->getMimeType(); $mimetype = $version->getMimeType();
if(isset($_convcmd[$mimetype])) { if(isset($_convcmd[$mimetype])) {
$cmd = sprintf($_convcmd[$mimetype], $path); $cmd = sprintf($_convcmd[$mimetype], $path);
$content = self::execWithTimeout($cmd, $timeout); try {
/* $content = self::execWithTimeout($cmd, $timeout);
$fp = popen($cmd, 'r'); if($content) {
if($fp) { $this->addField(Zend_Search_Lucene_Field::UnStored('content', $content, 'utf-8'));
$content = '';
while(!feof($fp)) {
$content .= fread($fp, 2048);
} }
pclose($fp); } catch (Exception $e) {
}
*/
if($content) {
$this->addField(Zend_Search_Lucene_Field::UnStored('content', $content, 'utf-8'));
} }
} }
} }

View File

@ -11,11 +11,11 @@
<email>uwe@steinmann.cx</email> <email>uwe@steinmann.cx</email>
<active>yes</active> <active>yes</active>
</lead> </lead>
<date>2016-04-28</date> <date>2017-03-01</date>
<time>08:11:19</time> <time>15:55:32</time>
<version> <version>
<release>1.1.9</release> <release>1.1.10</release>
<api>1.1.7</api> <api>1.1.10</api>
</version> </version>
<stability> <stability>
<release>stable</release> <release>stable</release>
@ -23,8 +23,7 @@
</stability> </stability>
<license uri="http://opensource.org/licenses/gpl-license">GPL License</license> <license uri="http://opensource.org/licenses/gpl-license">GPL License</license>
<notes> <notes>
pass variables to stream_select() to fullfill strict standards. catch exception in execWithTimeout()
make all functions in Indexer.php static
</notes> </notes>
<contents> <contents>
<dir baseinstalldir="SeedDMS" name="/"> <dir baseinstalldir="SeedDMS" name="/">
@ -235,5 +234,22 @@ add command for indexing postѕcript files
set last parameter of stream_select() to 200000 micro sec. in case the timeout in sec. is set to 0 set last parameter of stream_select() to 200000 micro sec. in case the timeout in sec. is set to 0
</notes> </notes>
</release> </release>
<release>
<date>2016-04-28</date>
<time>08:11:19</time>
<version>
<release>1.1.9</release>
<api>1.1.7</api>
</version>
<stability>
<release>stable</release>
<api>stable</api>
</stability>
<license uri="http://opensource.org/licenses/gpl-license">GPL License</license>
<notes>
pass variables to stream_select() to fullfill strict standards.
make all functions in Indexer.php static
</notes>
</release>
</changelog> </changelog>
</package> </package>