From db49f2b1e77248328388213bea238a0b5956966f Mon Sep 17 00:00:00 2001 From: Paolo Date: Fri, 4 Mar 2022 19:47:32 +0100 Subject: [PATCH] - libraries/DocsboxLib: - Added new constant DEFAULT_FORMAT - ERROR and SUCCESS constant values are the same of EXIT_ERROR and EXIT_SUCCESS - public method convert parameter format does not have a default value anymore - Added use import of ZipArchive - libraries/DocumentLib: removed unused variables --- application/libraries/DocsboxLib.php | 23 +++++++++++++++-------- application/libraries/DocumentLib.php | 7 ++++--- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/application/libraries/DocsboxLib.php b/application/libraries/DocsboxLib.php index ce43f1bc5..5ec028a49 100644 --- a/application/libraries/DocsboxLib.php +++ b/application/libraries/DocsboxLib.php @@ -1,11 +1,11 @@ body != '') { // Output directory where to unzip the downloaded zip file - $outputDirectory = dirname($outputFileName); + $outputDirectory = dirname($outputFileName); // The path and name of the downloaded zip file $temporaryDownloadedZip = sys_get_temp_dir().'/'.basename($resultUrl); diff --git a/application/libraries/DocumentLib.php b/application/libraries/DocumentLib.php index d78a9c0df..eec3b6938 100644 --- a/application/libraries/DocumentLib.php +++ b/application/libraries/DocumentLib.php @@ -14,6 +14,7 @@ class DocumentLib // Gets CI instance $this->ci =& get_instance(); + // Which document converter has to be used if (defined('DOCSBOX_ENABLED') && DOCSBOX_ENABLED === true) { // Use docsbox!! @@ -119,7 +120,7 @@ class DocumentLib finfo_close($finfo); - exec($cmd, $out, $ret); + exec($cmd, null, $ret); if ($ret != 0) { return error('PDF-zusammenfuegung ist derzeit nicht möglich. Bitte informieren Sie den Administrator'); @@ -154,7 +155,7 @@ class DocumentLib $command = 'unoconv -f %s --output %s %s 2>&1'; $command = sprintf($command, $format, $outFile, $inFile); - exec($command, $out, $ret); + exec($command, null, $ret); } if ($ret != 0) @@ -217,7 +218,7 @@ class DocumentLib $cmd .= '/countspaces { [ exch { dup 32 ne { pop } if } forall ] length } bind def >> '; $cmd .= 'setpagedevice viewJPEG"'; - exec($cmd, $out, $ret); + exec($cmd, null, $ret); if ($ret != 0) { $this->errormsg = 'jpegToPdf ist derzeit nicht möglich. Bitte informieren Sie den Administrator';