From 6b317b4e2e46b5412b72fb17a4bc36ff4c8a174c Mon Sep 17 00:00:00 2001 From: Nicola Asuni Date: Wed, 6 Feb 2013 20:04:08 +0000 Subject: [PATCH] 5.9.205 (2013-02-06) - The constant K_TCPDF_THROW_EXCEPTION_ERROR was added on configuration file to change the behavior of Error() method. - PDF417 barcode bug was fixed. --- CHANGELOG.TXT | 4 ++++ README.TXT | 4 ++-- composer.json | 2 +- config/tcpdf_config.php | 9 +++++++-- config/tcpdf_config_alt.php | 9 +++++++-- pdf417.php | 8 ++++---- tcpdf.php | 12 ++++++------ 7 files changed, 31 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.TXT b/CHANGELOG.TXT index 50b1eff..f4e505d 100755 --- a/CHANGELOG.TXT +++ b/CHANGELOG.TXT @@ -1,3 +1,7 @@ +5.9.205 (2013-02-06) + - The constant K_TCPDF_THROW_EXCEPTION_ERROR was added on configuration file to change the behavior of Error() method. + - PDF417 barcode bug was fixed. + 5.9.204 (2013-01-23) - The method Bookmark() was extended to include named destinations, URLs, internal links or embedded files (see example n. 15). - automatic path calculation on configuration file was fixed. diff --git a/README.TXT b/README.TXT index 51accdc..e271017 100755 --- a/README.TXT +++ b/README.TXT @@ -8,8 +8,8 @@ http://sourceforge.net/donate/index.php?group_id=128076 ------------------------------------------------------------ Name: TCPDF -Version: 5.9.204 -Release date: 2013-01-30 +Version: 5.9.205 +Release date: 2013-02-06 Author: Nicola Asuni Copyright (c) 2002-2013: diff --git a/composer.json b/composer.json index a67b116..f1644c1 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "tecnick.com/tcpdf", - "version": "5.9.204", + "version": "5.9.205", "homepage": "http://www.tcpdf.org/", "type": "library", "description": "TCPDF is a PHP class for generating PDF documents.", diff --git a/config/tcpdf_config.php b/config/tcpdf_config.php index e47e5c8..f5c0a18 100755 --- a/config/tcpdf_config.php +++ b/config/tcpdf_config.php @@ -2,13 +2,13 @@ //============================================================+ // File name : tcpdf_config.php // Begin : 2004-06-11 -// Last Update : 2013-01-28 +// Last Update : 2013-02-06 // // Description : Configuration file for TCPDF. // Author : Nicola Asuni - Tecnick.com LTD - Manor Coach House, Church Hill, Aldershot, Hants, GU12 4RQ, UK - www.tecnick.com - info@tecnick.com // License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html) // ------------------------------------------------------------------- -// Copyright (C) 2004-2012 Nicola Asuni - Tecnick.com LTD +// Copyright (C) 2004-2013 Nicola Asuni - Tecnick.com LTD // // This file is part of TCPDF software library. // @@ -246,6 +246,11 @@ if (!defined('K_TCPDF_EXTERNAL_CONFIG')) { * IMPORTANT: For security reason, disable this feature if you are printing user HTML content. */ define('K_TCPDF_CALLS_IN_HTML', true); + + /** + * if true adn PHP version is greater than 5, then the Error() method throw new exception instead of terminating the execution. + */ + define('K_TCPDF_THROW_EXCEPTION_ERROR', false); } //============================================================+ diff --git a/config/tcpdf_config_alt.php b/config/tcpdf_config_alt.php index 8e61445..d5460e5 100755 --- a/config/tcpdf_config_alt.php +++ b/config/tcpdf_config_alt.php @@ -2,13 +2,13 @@ //============================================================+ // File name : tcpdf_config.php // Begin : 2004-06-11 -// Last Update : 2013-01-28 +// Last Update : 2013-02-06 // // Description : Alternative configuration file for TCPDF. // Author : Nicola Asuni - Tecnick.com LTD - Manor Coach House, Church Hill, Aldershot, Hants, GU12 4RQ, UK - www.tecnick.com - info@tecnick.com // License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html) // ------------------------------------------------------------------- -// Copyright (C) 2004-2012 Nicola Asuni - Tecnick.com LTD +// Copyright (C) 2004-2013 Nicola Asuni - Tecnick.com LTD // // This file is part of TCPDF software library. // @@ -242,6 +242,11 @@ define('K_THAI_TOPCHARS', true); */ define('K_TCPDF_CALLS_IN_HTML', true); +/** + * if true adn PHP version is greater than 5, then the Error() method throw new exception instead of terminating the execution. + */ +define('K_TCPDF_THROW_EXCEPTION_ERROR', false); + //============================================================+ // END OF FILE //============================================================+ diff --git a/pdf417.php b/pdf417.php index b5e895b..827e12a 100755 --- a/pdf417.php +++ b/pdf417.php @@ -1,13 +1,13 @@ * @package com.tecnick.tcpdf * @author Nicola Asuni - * @version 5.9.204 + * @version 5.9.205 */ // Main configuration file. Define the K_TCPDF_EXTERNAL_CONFIG constant to skip this file. @@ -151,7 +151,7 @@ require_once(dirname(__FILE__).'/config/tcpdf_config.php'); * TCPDF project (http://www.tcpdf.org) has been originally derived in 2002 from the Public Domain FPDF class by Olivier Plathey (http://www.fpdf.org), but now is almost entirely rewritten.
* @package com.tecnick.tcpdf * @brief PHP class for generating PDF documents without requiring external extensions. - * @version 5.9.204 + * @version 5.9.205 * @author Nicola Asuni - info@tecnick.com */ class TCPDF { @@ -162,7 +162,7 @@ class TCPDF { * Current TCPDF version. * @private */ - private $tcpdf_version = '5.9.204'; + private $tcpdf_version = '5.9.205'; // Protected properties @@ -3844,7 +3844,7 @@ class TCPDF { $this->_destroy(true); $phpmainver = PHP_VERSION; // exit program and print error - if (intval($phpmainver[0]) < 5) { + if ((intval($phpmainver[0]) < 5) OR !defined('K_TCPDF_THROW_EXCEPTION_ERROR') OR !K_TCPDF_THROW_EXCEPTION_ERROR) { die('TCPDF ERROR: '.$msg); } else { throw new Exception('TCPDF ERROR: '.$msg);