2021-10-06 13:03:03 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Implementation of conversion service base class
|
|
|
|
*
|
|
|
|
* @category DMS
|
|
|
|
* @package SeedDMS
|
|
|
|
* @license GPL 2
|
|
|
|
* @version @version@
|
|
|
|
* @author Uwe Steinmann <uwe@steinmann.cx>
|
|
|
|
* @copyright Copyright (C) 2021 Uwe Steinmann
|
|
|
|
* @version Release: @package_version@
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Implementation of conversion service base class
|
|
|
|
*
|
|
|
|
* @category DMS
|
|
|
|
* @package SeedDMS
|
|
|
|
* @author Uwe Steinmann <uwe@steinmann.cx>
|
|
|
|
* @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;
|
|
|
|
|
2023-01-19 11:10:33 +00:00
|
|
|
/**
|
|
|
|
* conversion manager
|
|
|
|
*/
|
|
|
|
protected $conversionmgr;
|
|
|
|
|
2023-01-05 07:04:07 +00:00
|
|
|
/**
|
|
|
|
* @var $success set to false if conversion failed
|
|
|
|
*/
|
|
|
|
protected $success;
|
|
|
|
|
2021-10-06 13:03:03 +00:00
|
|
|
public function __construct() {
|
|
|
|
$this->from = null;
|
|
|
|
$this->to = null;
|
2023-01-05 07:04:07 +00:00
|
|
|
$this->success = true;
|
2023-01-19 11:10:33 +00:00
|
|
|
$this->logger = null;
|
|
|
|
$this->conversionmgr = null;
|
2021-10-06 13:03:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public function setLogger($logger) {
|
|
|
|
$this->logger = $logger;
|
|
|
|
}
|
|
|
|
|
2023-01-19 11:10:33 +00:00
|
|
|
public function setConversionMgr($conversionmgr) {
|
|
|
|
$this->conversionmgr = $conversionmgr;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getConversionMgr() {
|
|
|
|
return $this->conversionmgr;
|
|
|
|
}
|
|
|
|
|
2021-10-06 13:03:03 +00:00
|
|
|
public function getInfo() {
|
|
|
|
return 'Conversion service';
|
|
|
|
}
|
|
|
|
|
2021-10-08 10:11:10 +00:00
|
|
|
public function getAdditionalParams() { /* {{{ */
|
|
|
|
return [];
|
|
|
|
} /* }}} */
|
|
|
|
|
2023-01-05 07:04:07 +00:00
|
|
|
public function wasSuccessful() { /* {{{ */
|
|
|
|
return $this->success;
|
|
|
|
} /* }}} */
|
|
|
|
|
2021-10-08 10:11:10 +00:00
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
*/
|
2021-10-06 13:03:03 +00:00
|
|
|
public function convert($infile, $target = null, $params = array()) {
|
2021-10-08 10:11:10 +00:00
|
|
|
return false;
|
2021-10-06 13:03:03 +00:00
|
|
|
}
|
|
|
|
}
|