noalyss-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Noalyss-commit] [noalyss] 01/107: replace tempname with sys_get_temp_di


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 01/107: replace tempname with sys_get_temp_dir
Date: Mon, 26 Aug 2019 10:31:45 -0400 (EDT)

sparkyx pushed a commit to branch master
in repository noalyss.

commit d85d6f8c77083fb997441a672d222bb10836af3e
Author: Dany De Bontridder <address@hidden>
Date:   Sat Dec 1 17:57:15 2018 +0100

    replace tempname with sys_get_temp_dir
---
 include/class/document_export.class.php | 9 +++++----
 include/constant.php                    | 2 +-
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/include/class/document_export.class.php 
b/include/class/document_export.class.php
index fea8edc..f491ab1 100644
--- a/include/class/document_export.class.php
+++ b/include/class/document_export.class.php
@@ -38,13 +38,13 @@ class Document_Export
         // Create 2 temporary folders   1. convert to PDF + stamp
         //                              2. store result
         $this->feedback = array();
-        $this->store_convert = tempnam($_ENV['TMP'], 'convert_');
-        $this->store_pdf = tempnam($_ENV['TMP'], 'pdf_');
+        $this->store_convert = tempnam(sys_get_temp_dir(), 'convert_');
+        $this->store_pdf = tempnam(sys_get_temp_dir(), 'pdf_');
         unlink($this->store_convert);
         unlink($this->store_pdf);
         umask(0);
-        mkdir($this->store_convert);
-        mkdir($this->store_pdf);
+        if ( mkdir($this->store_convert) == FALSE )            throw new 
Exception(sprintf("Create %s failed",$this->store_onvert));
+        if ( mkdir($this->store_pdf)== FALSE )            throw new 
Exception(sprintf("Create %s failed",$this->store_pdf));
     }
     /**
      * @brief concatenate all PDF into a single one and save it into the
@@ -177,6 +177,7 @@ class Document_Export
                 $cnt_feedback++;
                 continue;
             }
+
       
              $progress->increment($step);
             // 
diff --git a/include/constant.php b/include/constant.php
index 34489ca..0e361d0 100644
--- a/include/constant.php
+++ b/include/constant.php
@@ -271,7 +271,7 @@ if ( ! file_exists($ps2pdf) )
 /**
  * Outil pour manipuler les PDF 
  */
-$pdftk='/usr/bin/pdftk';
+$pdftk='/snap/bin/pdftk';
 if (file_exists($pdftk))
 {
     define ('PDFTK',$pdftk);  



reply via email to

[Prev in Thread] Current Thread [Next in Thread]