Merge branch 'seeddms-5.1.x' into seeddms-6.0.x

This commit is contained in:
Uwe Steinmann 2026-03-20 12:37:32 +01:00
commit b61967bef5

View File

@ -83,6 +83,7 @@ class SeedDMS_ConversionServiceExec extends SeedDMS_ConversionServiceBase {
fclose($pipes[0]);
fclose($pipes[1]);
fclose($pipes[2]);
if ($timeleft <= 0) {
proc_terminate($process);
throw new Exception("command timeout after ".$orgtimeout." secs on: " . $cmd);
@ -98,6 +99,10 @@ class SeedDMS_ConversionServiceExec extends SeedDMS_ConversionServiceBase {
$this->to = $to;
$this->cmd = $cmd;
$this->timeout = ((int) $timeout) ? (int) $timeout : 5;
/* Command fails if stderr is not empty */
$this->failonstderr = true;
/* Command fails if return code is not 0 */
$this->failonretcode = false;
}
public function getInfo() {
@ -178,9 +183,17 @@ class SeedDMS_ConversionServiceExec extends SeedDMS_ConversionServiceBase {
}
if(!empty($ret['stderr'])) {
if($this->logger) {
$this->logger->log('Conversion from '.$this->from.' to '.$this->to.' with cmd "'.$this->cmd.'" failed: '.$ret['stderr'], PEAR_LOG_ERR);
$this->logger->log('Conversion from '.$this->from.' to '.$this->to.' with cmd "'.$this->cmd.'" failed: stderr is '.$ret['stderr'], PEAR_LOG_ERR);
}
return false;
if ($this->failonstderr)
return false;
}
if(!empty($ret['return'])) {
if($this->logger) {
$this->logger->log('Conversion from '.$this->from.' to '.$this->to.' with cmd "'.$this->cmd.'" failed: Error code '.$ret['return'], PEAR_LOG_ERR);
}
if ($this->failonretcode)
return false;
}
$end = microtime(true);
if($this->logger) {