some more documentation

This commit is contained in:
Uwe Steinmann 2023-01-03 14:07:38 +01:00
parent d8e9cb5707
commit e54874c3ff

View File

@ -72,18 +72,25 @@ class SeedDMS_ConversionMgr {
* @param string $file name of file to convert * @param string $file name of file to convert
* @param string $from mimetype of input file * @param string $from mimetype of input file
* @param string $to mimetype of output file * @param string $to mimetype of output file
* @param string $target name of target file. If none is given the
* content of the converted document will be returned.
* @param array $params additional parameter needed for the conversion,
* e.g. the width of an image
* *
* @return boolean true on success, other false * @return boolean true on success, other false
*/ */
public function convert($file, $from, $to, $target=null, $params=array()) { public function convert($file, $from, $to, $target=null, $params=array()) { /* {{{ */
if(isset($this->services[$from][$to])) { if(isset($this->services[$from][$to])) {
$services = $this->services[$from][$to]; $services = $this->services[$from][$to];
for(end($services); key($services)!==null; prev($services)) { for(end($services); key($services)!==null; prev($services)) {
$service = current($services); $service = current($services);
$text = $service->convert($file, $target, $params); $text = $service->convert($file, $target, $params);
if($text !== false) if($text === false)
return false;
if($text)
return $text; return $text;
} }
} }
} return true;
} /* }}} */
} }