From c75a83d1d2197a96487d90fbfaf669406b8b0d5d Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Wed, 21 Aug 2013 01:06:33 +0200 Subject: [PATCH] PDF fixes --- library/Icinga/File/Pdf.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/library/Icinga/File/Pdf.php b/library/Icinga/File/Pdf.php index eca2b1f19..b2a235104 100644 --- a/library/Icinga/File/Pdf.php +++ b/library/Icinga/File/Pdf.php @@ -6,17 +6,14 @@ use TCPDF; use Icinga\Web\Url; use Icinga\Application\Icinga; -// $_SERVER['DOCUMENT_ROOT'] = '/'; -$_SERVER['DOCUMENT_ROOT'] = Icinga::app()->getApplicationDir() . '/../public'; define('K_TCPDF_EXTERNAL_CONFIG', true); - -//define('K_PATH_URL', 'http://net-test-icinga-vm1.adm.netways.de/develop/'); // ??? -// define('K_PATH_URL', '/var/www/net-test-icinga-vm1.adm.netways.de/develop/public'); // ??? -define('K_PATH_URL', (string) Url::fromPath('/') === '/' ? '' : (string) Url::fromPath('/')); // ???'/')); +define('K_PATH_URL', (string) Url::create('/')); define('K_PATH_MAIN', dirname(ICINGA_LIBDIR) . '/public'); define('K_PATH_FONTS', ICINGA_LIBDIR . '/vendor/tcpdf/fonts/'); -define('K_PATH_CACHE', ICINGA_LIBDIR . '/vendor/tcpdf/cache/'); -define('K_PATH_URL_CACHE', ICINGA_LIBDIR . '/vendor/tcpdf/cache/'); +// define('K_PATH_CACHE', ICINGA_LIBDIR . '/vendor/tcpdf/cache/'); +// define('K_PATH_URL_CACHE', ICINGA_LIBDIR . '/vendor/tcpdf/cache/'); +define('K_PATH_CACHE', '/tmp/'); +define('K_PATH_URL_CACHE', '/tmp/'); //define('K_PATH_IMAGES', K_PATH_MAIN . 'images/'); // ??? define('K_PATH_IMAGES', dirname(ICINGA_LIBDIR) . '/public'); // ??? define('K_BLANK_IMAGE', K_PATH_IMAGES.'_blank.png'); // COULD be anything? @@ -41,6 +38,7 @@ class Pdf extends TCPDF $diskcache = false, $pdfa = false ) { + unset($_SERVER['DOCUMENT_ROOT']); parent::__construct( $orientation, $unit,