Commit a70d209d authored by Laurent Lecluse's avatar Laurent Lecluse
Browse files

Unoconv : pouvoir utiliser un serveur dédié

parent 1341df76
Loading
Loading
Loading
Loading
Loading
+32 −2
Original line number Diff line number Diff line
@@ -71,13 +71,18 @@ class Document
    /**
     * @var string
     */
    private $convCommand = 'unoconv -f pdf -o :outputFile :inputFile';
    private $convCommand = 'unoconv --server=:host -f pdf -o :outputFile :inputFile';

    /**
     * @var string
     */
    private $tmpDir;

    /**
     * @var string
     */
    private $host = '127.0.0.1';

    /**
     * @var array
     */
@@ -654,7 +659,8 @@ class Document
    {
        $command = $this->getConvCommand();

        $command = str_replace(':inputFile', $origine, $this->getConvCommand());
        $command = str_replace(':host', $this->getHost(), $this->getConvCommand());
        $command = str_replace(':inputFile', $origine, $command);
        $command = str_replace(':outputFile', $destination, $command);
        exec($command, $output, $return);

@@ -726,6 +732,30 @@ class Document



    /**
     * @return string
     */
    public function getHost(): string
    {
        return $this->host;
    }



    /**
     * @param string $host
     *
     * @return Document
     */
    public function setHost(string $host)
    {
        $this->host = $host;

        return $this;
    }



    /**
     * @param null $prefix
     *