* @copyright Copyright (C) 2021 Uwe Steinmann * @version Release: @package_version@ */ /** * Implementation of conversion service base class * * @category DMS * @package SeedDMS * @author Uwe Steinmann * @copyright Copyright (C) 2021 Uwe Steinmann * @version Release: @package_version@ */ abstract class SeedDMS_ConversionServiceBase { /** * mimetype original file */ public $from; /** * mimetype converted file */ public $to; /** * logger */ protected $logger; /** * @var $success set to false if conversion failed */ protected $success; public function __construct() { $this->from = null; $this->to = null; $this->success = true; } public function setLogger($logger) { $this->logger = $logger; } public function getInfo() { return 'Conversion service'; } public function getAdditionalParams() { /* {{{ */ return []; } /* }}} */ public function wasSuccessful() { /* {{{ */ return $this->success; } /* }}} */ /** * This method does the conversion * * It either returns the content of converted file (if $target is null) * or writes the converted file into $target and returns true on success * or false on error. */ public function convert($infile, $target = null, $params = array()) { return false; } }