Validate existence of PDF Renderer library before instantiating renderer class

git-svn-id: https://phpexcel.svn.codeplex.com/svn/trunk@91572 2327b42d-5241-43d6-9e2a-de5ac946f064
This commit is contained in:
Mark Baker 2012-06-10 22:05:00 +00:00
parent 3783c7e099
commit 1b642d4e7d
3 changed files with 19 additions and 4 deletions

View File

@ -27,7 +27,12 @@
/** Require DomPDF library */
require_once PHPExcel_Settings::getPdfRendererPath() . '/dompdf_config.inc.php';
$pdfRendererClassFile = PHPExcel_Settings::getPdfRendererPath() . '/dompdf_config.inc.php';
if (file_exists($pdfRendererClassFile)) {
require_once $pdfRendererClassFile;
} else {
throw new Exception('Unable to load PDF Rendering library');
}
/**
* PHPExcel_Writer_PDF_DomPDF

View File

@ -27,7 +27,12 @@
/** Require mPDF library */
require_once PHPExcel_Settings::getPdfRendererPath() . '/mpdf.php';
$pdfRendererClassFile = PHPExcel_Settings::getPdfRendererPath() . '/mpdf.php';
if (file_exists($pdfRendererClassFile)) {
require_once $pdfRendererClassFile;
} else {
throw new Exception('Unable to load PDF Rendering library');
}
/**
* PHPExcel_Writer_PDF_mPDF

View File

@ -27,8 +27,13 @@
/** Require tcPDF library */
$k_path_url = PHPExcel_Settings::getPdfRendererPath();
require_once PHPExcel_Settings::getPdfRendererPath() . '/tcpdf.php';
$pdfRendererClassFile = PHPExcel_Settings::getPdfRendererPath() . '/tcpdf.php';
if (file_exists($pdfRendererClassFile)) {
$k_path_url = PHPExcel_Settings::getPdfRendererPath();
require_once $pdfRendererClassFile;
} else {
throw new Exception('Unable to load PDF Rendering library');
}
/**
* PHPExcel_Writer_PDF_tcPDF