File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,13 @@ class ExcelFile extends Object
1515 */
1616 public $ writerClass = '\PHPExcel_Writer_Excel2007 ' ;
1717
18+ /**
19+ * @var array options to pass to the constructor of \mikehaertl\tmp\File,
20+ * indexed by option name. Available keys are 'suffix', 'prefix' and 'directory'.
21+ * This is only useful if creation of the temporary file fails for some reason.
22+ */
23+ public $ fileOptions = [];
24+
1825 protected $ _writer ;
1926 protected $ _workbook ;
2027 protected $ _sheets ;
@@ -50,7 +57,10 @@ public function getWorkbook()
5057 public function getTmpFile ()
5158 {
5259 if ($ this ->_tmpFile ===null ) {
53- $ this ->_tmpFile = new File ('' );
60+ $ suffix = isset ($ this ->fileOptions ['suffix ' ]) ? $ this ->fileOptions ['suffix ' ] : null ;
61+ $ prefix = isset ($ this ->fileOptions ['prefix ' ]) ? $ this ->fileOptions ['prefix ' ] : null ;
62+ $ directory = isset ($ this ->fileOptions ['directory ' ]) ? $ this ->fileOptions ['directory ' ] : null ;
63+ $ this ->_tmpFile = new File ('' , $ suffix , $ prefix , $ directory );
5464 }
5565 return $ this ->_tmpFile ;
5666 }
You can’t perform that action at this time.
0 commit comments