You are here

function pdf_using_mpdf_is_writable in PDF using mPDF 7.2

1 call to pdf_using_mpdf_is_writable()
_pdf_using_mpdf_generator in ./pdf_using_mpdf.module
Generate the PDF file using the mPDF library.

File

./pdf_using_mpdf.module, line 427
Prints PDF for a given html node view.

Code

function pdf_using_mpdf_is_writable($path) {
  if ($path[strlen($path) - 1] == '/') {
    return drupal_is_writable($path . uniqid(mt_rand()) . '.tmp');
  }
  elseif (is_dir($path)) {
    return pdf_using_mpdf_is_writable($path . '/' . uniqid(mt_rand()) . '.tmp');
  }
  $rm = file_exists($path);
  $f = @fopen($path, 'a');
  if ($f === FALSE) {
    return FALSE;
  }
  fclose($f);
  if (!$rm) {
    unlink($path);
  }
  return TRUE;
}