summaryrefslogtreecommitdiffstats
path: root/tcpdf-vendor.patch
blob: 44d89012a1e41b9fc76dee24c20ad6b9f801765e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
diff -ru 016-2/config/tcpdf_config.php tcpdf/config/tcpdf_config.php
--- 016-2/config/tcpdf_config.php	2013-05-15 19:06:17.000000000 +0200
+++ tcpdf/config/tcpdf_config.php	2013-05-16 13:42:59.000000000 +0200
@@ -54,39 +54,16 @@
 	// be sure that the end slash is present
 	$_SERVER['DOCUMENT_ROOT'] = str_replace('//', '/', $_SERVER['DOCUMENT_ROOT'].'/');
 
-	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-	// Try to automatically set the value for the following K_PATH_MAIN constant.
-	// NOTE: delete this section and manually set the K_PATH_MAIN constant below for better performances.
-	$tcpdf_install_dirs = array();
-	if ((strpos(dirname(__FILE__), '/config') !== false) OR (strpos(dirname(__FILE__), '\config') !== false)) {
-		// default config file
-		$k_path_main_default = str_replace( '\\', '/', realpath(substr(dirname(__FILE__), 0, 0-strlen('config'))));
-		if (substr($k_path_main_default, -1) != '/') {
-			$k_path_main_default .= '/';
-		}
-		$tcpdf_install_dirs[] = $k_path_main_default;
-	}
-	$tcpdf_install_dirs += array('/usr/share/php/tcpdf/', '/usr/share/tcpdf/', '/usr/share/php-tcpdf/', '/var/www/tcpdf/', '/var/www/html/tcpdf/', '/usr/local/apache2/htdocs/tcpdf/');
-	foreach ($tcpdf_install_dirs as $k_path_main) {
-		if (file_exists($k_path_main.'tcpdf.php')) {
-			break;
-		}
-	}
-	if (!file_exists($k_path_main)) {
-		die('TCPDF ERROR: please set the correct path to TCPDF on the configuration file');
-	}
-	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
 	/**
 	 * Installation path (/var/www/tcpdf/).
 	 * By default it is automatically calculated but you can also set it as a fixed string to improve performances.
 	 */
-	define ('K_PATH_MAIN', $k_path_main);
+	define ('K_PATH_MAIN', '/usr/share/php/tcpdf/');
 
 	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 	// Try to automatically set the value for the following K_PATH_URL constant.
 	// NOTE: delete this section and manually set the K_PATH_URL constant below for better performances.
-	$k_path_url = $k_path_main; // default value for console mode
+	$k_path_url = K_PATH_MAIN; // default value for console mode
 	if (isset($_SERVER['HTTP_HOST']) AND (!empty($_SERVER['HTTP_HOST']))) {
 		if(isset($_SERVER['HTTPS']) AND (!empty($_SERVER['HTTPS'])) AND (strtolower($_SERVER['HTTPS']) != 'off')) {
 			$k_path_url = 'https://';
@@ -114,22 +91,11 @@
 	 */
 	define ('K_PATH_FONTS', K_PATH_MAIN.'fonts/');
 
-	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-	// Try to automatically set the value for the following K_PATH_IMAGES constant.
-	// NOTE: delete this section and manually set the K_PATH_IMAGES constant below for better performances.
-	$tcpdf_images_dirs = array(K_PATH_MAIN.'examples/images/', '/usr/share/doc/tcpdf/examples/images/', '/usr/share/doc/php-tcpdf/examples/images/', '/usr/share/doc/php/tcpdf/examples/images/', '/var/www/tcpdf/images/', '/var/www/html/tcpdf/images/', '/usr/local/apache2/htdocs/tcpdf/images/', K_PATH_MAIN);
-	foreach ($tcpdf_images_dirs as $tcpdf_images_path) {
-		if (file_exists($tcpdf_images_path)) {
-			break;
-		}
-	}
-	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
 	/**
 	 * Default images directory.
 	 * By default it is automatically set but you can also set it as a fixed string to improve performances.
 	 */
-	define ('K_PATH_IMAGES', $tcpdf_images_path);
+	define ('K_PATH_IMAGES', K_PATH_MAIN.'images/');
 
 	/**
 	 * Blank image.
@@ -166,20 +132,11 @@
 	 */
 	define ('PDF_HEADER_STRING', "by Nicola Asuni - Tecnick.com\nwww.tcpdf.org");
 
-	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-	// Try to automatically set the value for the following K_PATH_IMAGES constant.
-	// NOTE: delete this section and manually set the K_PATH_IMAGES constant below for better performances.
-	$tcpdf_header_logo = '';
-	if (file_exists(K_PATH_IMAGES.'tcpdf_logo.jpg')) {
-		$tcpdf_header_logo = 'tcpdf_logo.jpg';
-	}
-	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
 	/**
 	 * Deafult image logo used be the default Header() method.
 	 * Please set here your own logo or an empty string to disable it.
 	 */
-	define ('PDF_HEADER_LOGO', $tcpdf_header_logo);
+	define ('PDF_HEADER_LOGO', '');
 
 	/**
 	 * Header logo image width [mm].
Seulement dans tcpdf/config: tcpdf_config.php~
diff -ru 016-2/examples/config/tcpdf_config_alt.php tcpdf/examples/config/tcpdf_config_alt.php
--- 016-2/examples/config/tcpdf_config_alt.php	2013-05-15 19:06:17.000000000 +0200
+++ tcpdf/examples/config/tcpdf_config_alt.php	2013-05-16 13:42:35.000000000 +0200
@@ -53,39 +53,16 @@
 // be sure that the end slash is present
 $_SERVER['DOCUMENT_ROOT'] = str_replace('//', '/', $_SERVER['DOCUMENT_ROOT'].'/');
 
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-// Try to automatically set the value for the following K_PATH_MAIN constant.
-// NOTE: delete this section and manually set the K_PATH_MAIN constant below for better performances.
-$tcpdf_install_dirs = array();
-if ((strpos(dirname(__FILE__), '/config') !== false) OR (strpos(dirname(__FILE__), '\config') !== false)) {
-	// default config file
-	$k_path_main_default = str_replace( '\\', '/', realpath(substr(dirname(__FILE__), 0, 0-strlen('examples/config'))));
-	if (substr($k_path_main_default, -1) != '/') {
-		$k_path_main_default .= '/';
-	}
-	$tcpdf_install_dirs[] = $k_path_main_default;
-}
-$tcpdf_install_dirs += array('/usr/share/php/tcpdf/', '/usr/share/tcpdf/', '/usr/share/php-tcpdf/', '/var/www/tcpdf/', '/var/www/html/tcpdf/', '/usr/local/apache2/htdocs/tcpdf/');
-foreach ($tcpdf_install_dirs as $k_path_main) {
-	if (file_exists($k_path_main.'tcpdf.php')) {
-		break;
-	}
-}
-if (!file_exists($k_path_main)) {
-	die('TCPDF ERROR: please set the correct path to TCPDF on the configuration file');
-}
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
 /**
  * Installation path (/var/www/tcpdf/).
  * By default it is automatically calculated but you can also set it as a fixed string to improve performances.
  */
-define ('K_PATH_MAIN', $k_path_main);
+define ('K_PATH_MAIN', '/usr/share/php/tcpdf/');
 
 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 // Try to automatically set the value for the following K_PATH_URL constant.
 // NOTE: delete this section and manually set the K_PATH_URL constant below for better performances.
-$k_path_url = $k_path_main; // default value for console mode
+$k_path_url = K_PATH_MAIN; // default value for console mode
 if (isset($_SERVER['HTTP_HOST']) AND (!empty($_SERVER['HTTP_HOST']))) {
 	if(isset($_SERVER['HTTPS']) AND (!empty($_SERVER['HTTPS'])) AND (strtolower($_SERVER['HTTPS']) != 'off')) {
 		$k_path_url = 'https://';
@@ -128,7 +105,7 @@
  * Default images directory.
  * By default it is automatically set but you can also set it as a fixed string to improve performances.
  */
-define ('K_PATH_IMAGES', $tcpdf_images_path);
+define ('K_PATH_IMAGES', dirname(__DIR__).'/images/');
 
 /**
  * Blank image.
@@ -165,20 +142,11 @@
  */
 define ('PDF_HEADER_STRING', "by Nicola Asuni - Tecnick.com\nwww.tcpdf.org");
 
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-// Try to automatically set the value for the following K_PATH_IMAGES constant.
-// NOTE: delete this section and manually set the K_PATH_IMAGES constant below for better performances.
-$tcpdf_header_logo = '';
-if (file_exists(K_PATH_IMAGES.'tcpdf_logo.jpg')) {
-	$tcpdf_header_logo = 'tcpdf_logo.jpg';
-}
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
 /**
  * Deafult image logo used be the default Header() method.
  * Please set here your own logo or an empty string to disable it.
  */
-define ('PDF_HEADER_LOGO', $tcpdf_header_logo);
+define ('PDF_HEADER_LOGO', 'tcpdf_logo.jpg');
 
 /**
  * Header logo image width [mm].
Seulement dans tcpdf/examples/config: tcpdf_config_alt.php~
diff -ru 016-2/examples/tcpdf_include.php tcpdf/examples/tcpdf_include.php
--- 016-2/examples/tcpdf_include.php	2013-05-14 18:39:40.000000000 +0200
+++ tcpdf/examples/tcpdf_include.php	2013-05-16 13:32:34.000000000 +0200
@@ -23,14 +23,9 @@
  * @since 2013-05-14
  */
 
-// Include the main TCPDF library (search the library on the following directories).
-$tcpdf_include_dirs = array(realpath('../tcpdf.php'), '/usr/share/php/tcpdf/tcpdf.php', '/usr/share/tcpdf/tcpdf.php', '/usr/share/php-tcpdf/tcpdf.php', '/var/www/tcpdf/tcpdf.php', '/var/www/html/tcpdf/tcpdf.php', '/usr/local/apache2/htdocs/tcpdf/tcpdf.php');
-foreach ($tcpdf_include_dirs as $tcpdf_include_path) {
-	if (file_exists($tcpdf_include_path)) {
-		require_once($tcpdf_include_path);
-		break;
-	}
-}
+// Include the main TCPDF library
+require_once(__DIR__.'/config/tcpdf_config_alt.php');
+require_once('/usr/share/php/tcpdf/tcpdf.php');
 
 //============================================================+
 // END OF FILE
Seulement dans tcpdf/examples: tcpdf_include.php~
diff -ru 016-2/tools/tcpdf_addfont.php tcpdf/tools/tcpdf_addfont.php
--- 016-2/tools/tcpdf_addfont.php	2013-05-15 17:25:21.000000000 +0200
+++ tcpdf/tools/tcpdf_addfont.php	2013-05-16 13:45:50.000000000 +0200
@@ -47,7 +47,7 @@
 }
 
 // Include the main TCPDF library (search the library on the following directories).
-$tcpdf_include_dirs = array(realpath('../tcpdf.php'), '/usr/share/php/tcpdf/tcpdf.php', '/usr/share/tcpdf/tcpdf.php', '/usr/share/php-tcpdf/tcpdf.php', '/var/www/tcpdf/tcpdf.php', '/var/www/html/tcpdf/tcpdf.php', '/usr/local/apache2/htdocs/tcpdf/tcpdf.php');
+$tcpdf_include_dirs = array(realpath(__DIR__.'/../tcpdf.php'), '/usr/share/php/tcpdf/tcpdf.php', '/usr/share/tcpdf/tcpdf.php', '/usr/share/php-tcpdf/tcpdf.php', '/var/www/tcpdf/tcpdf.php', '/var/www/html/tcpdf/tcpdf.php', '/usr/local/apache2/htdocs/tcpdf/tcpdf.php');
 foreach ($tcpdf_include_dirs as $tcpdf_include_path) {
 	if (file_exists($tcpdf_include_path)) {
 		require_once($tcpdf_include_path);
Seulement dans tcpdf/tools: tcpdf_addfont.php~