iterate over all service until a working one is found

This commit is contained in:
Uwe Steinmann 2021-10-29 19:55:01 +02:00
parent 29bf7cd062
commit 4abdb104f0

View File

@ -62,8 +62,13 @@ class SeedDMS_ConversionMgr {
*/
public function convert($file, $from, $to, $target=null, $params=array()) {
if(isset($this->services[$from][$to])) {
$service = end($this->services[$from][$to]);
return $service->convert($file, $target, $params);
$services = $this->services[$from][$to];
for(end($services); key($services)!==null; prev($services)) {
$service = current($services);
$text = $service->convert($file, $target, $params);
if($text !== false)
return $text;
}
}
}
}