Skip to content

Commit

Permalink
Merge pull request #513 from DiamondLightSource/Fix/Fix_no_pdf_temp_d…
Browse files Browse the repository at this point in the history
…ir_config

Fix/fix no pdf temp dir config
  • Loading branch information
John-Holt-Tessella authored Mar 31, 2023
2 parents 6a5b817 + db5f64b commit a8b92df
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions api/src/Page/PDF.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ function __construct(Slim $app, $db, $user)
// Creating the temp folder here means we have the correct permissions
// Using separate folders for temp and font data so mpdf does not try to delete ttfontdata
global $pdf_tmp_dir;
$this->pdf_tmp_dir = $pdf_tmp_dir;
$mpdf_temp = $pdf_tmp_dir . "/mpdf/temp/";
$mpdf_font_data = $pdf_tmp_dir . "/mpdf/ttfontdata/";
$this->pdf_tmp_dir = $pdf_tmp_dir ? $pdf_tmp_dir : "/tmp";
$mpdf_temp = $this->pdf_tmp_dir . "/mpdf/temp/";
$mpdf_font_data = $this->pdf_tmp_dir . "/mpdf/ttfontdata/";

if (!is_dir($mpdf_temp)) {
mkdir($mpdf_temp, 0775, true);
Expand Down

0 comments on commit a8b92df

Please sign in to comment.