Browse Source

Log CUPS print error on Receipt Printer module

Important help to debug errors on CUPS printing
andreubisquerra 5 years ago
parent
commit
493e07a14e

+ 1 - 0
htdocs/includes/mike42/escpos-php/src/Mike42/Escpos/PrintConnectors/CupsPrintConnector.php

@@ -78,6 +78,7 @@ class CupsPrintConnector implements PrintConnector
         
         // Build command to work on data
         $tmpfname = tempnam(sys_get_temp_dir(), 'print-');
+		if ($tmpfname==false) dol_syslog("CupsPrintConnector.php::Permission denied to write into target directory ".sys_get_temp_dir(), LOG_WARNING);
         file_put_contents($tmpfname, $data);
         $cmd = sprintf(
             "lp -d %s %s",