This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Do not load DOMPDF if not there.

  • Loading branch information...
greut committed Mar 19, 2012
1 parent d7acb0d commit b4555fcccd2cf43d59d83321b7af3cc68ac10dad
Showing with 12 additions and 12 deletions.
  1. +12 −12 config/bootstrap.php
View
@@ -6,23 +6,23 @@
define('DOMPDF_LIBRARY_PATH', LITHIUM_LIBRARY_PATH . '/dompdf/dompdf');
}
-define('DOMPDF_INC_DIR', DOMPDF_LIBRARY_PATH . '/include', true);
-define('DOMPDF_LIB_DIR', DOMPDF_LIBRARY_PATH . '/lib', true);
+if (file_exists(DOMPDF_LIBRARY_PATH)) {
+ define('DOMPDF_INC_DIR', DOMPDF_LIBRARY_PATH . '/include', true);
+ define('DOMPDF_LIB_DIR', DOMPDF_LIBRARY_PATH . '/lib', true);
-require DOMPDF_INC_DIR . '/functions.inc.php';
+ require DOMPDF_INC_DIR . '/functions.inc.php';
+ $name = 'dompdf';
+ $library = Libraries::get($name);
-$name = 'dompdf';
-$library = Libraries::get($name);
-
-if (empty($library)) {
- Libraries::add($name, array(
- 'bootstrap' => false,
- 'path' => DOMPDF_LIBRARY_PATH
- ));
+ if (empty($library)) {
+ Libraries::add($name, array(
+ 'bootstrap' => false,
+ 'path' => DOMPDF_LIBRARY_PATH
+ ));
+ }
}
-
/**
* Configure media to output PDF
*/

0 comments on commit b4555fc

Please sign in to comment.