summaryrefslogtreecommitdiffstats
path: root/php-tcpdf_config.patch
blob: 10cd0209685274d255cd1152da32ed761e93cb5c (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
diff -up tcpdf/config/tcpdf_config_alt.php.config tcpdf/config/tcpdf_config_alt.php
--- tcpdf/config/tcpdf_config_alt.php.config	2013-04-21 21:15:04.000000000 +0200
+++ tcpdf/config/tcpdf_config_alt.php	2013-05-10 08:52:56.098202050 +0200
@@ -61,7 +61,7 @@ if (substr($k_path_main, -1) != '/') {
  * 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/');
 
 // Automatic calculation for the following K_PATH_URL constant
 if (isset($_SERVER['HTTP_HOST']) AND (!empty($_SERVER['HTTP_HOST']))) {
@@ -89,7 +89,12 @@ define ('K_PATH_FONTS', K_PATH_MAIN.'fon
 /**
  * cache directory for temporary files (full path)
  */
-define ('K_PATH_CACHE', K_PATH_MAIN.'cache/');
+$k_path_cache = '/var/cache/php-tcpdf/'.posix_getuid().'/';
+if (is_dir($k_path_cache) && is_writable($k_path_cache)) {
+	define ('K_PATH_CACHE', $k_path_cache);
+} else {
+	define ('K_PATH_CACHE', sys_get_temp_dir().'/');
+}
 
 /**
  * cache directory for temporary files (url path)
diff -up tcpdf/config/tcpdf_config.php.config tcpdf/config/tcpdf_config.php
--- tcpdf/config/tcpdf_config.php.config	2013-04-21 21:15:04.000000000 +0200
+++ tcpdf/config/tcpdf_config.php	2013-05-10 08:55:59.206957827 +0200
@@ -65,7 +65,7 @@ if (!defined('K_TCPDF_EXTERNAL_CONFIG'))
 	 * 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/');
 
 	// Automatic calculation for the following K_PATH_URL constant
 	$k_path_url = $k_path_main; // default value for console mode
@@ -94,7 +94,12 @@ if (!defined('K_TCPDF_EXTERNAL_CONFIG'))
 	/**
 	 * cache directory for temporary files (full path)
 	 */
-	define ('K_PATH_CACHE', K_PATH_MAIN.'cache/');
+	$k_path_cache = '/var/cache/php-tcpdf/'.posix_getuid().'/';
+	if (is_dir($k_path_cache) && is_writable($k_path_cache)) {
+		define ('K_PATH_CACHE', $k_path_cache);
+	} else {
+		define ('K_PATH_CACHE', sys_get_temp_dir().'/');
+	}
 
 	/**
 	 * cache directory for temporary files (url path)
diff -up tcpdf/tcpdf.php.config tcpdf/tcpdf.php
--- tcpdf/tcpdf.php.config	2013-05-10 08:52:06.656998071 +0200
+++ tcpdf/tcpdf.php	2013-05-10 08:52:06.669998125 +0200
@@ -144,7 +144,7 @@
 
 if (!defined('K_TCPDF_EXTERNAL_CONFIG')) {
 	// Main configuration file. Define the K_TCPDF_EXTERNAL_CONFIG constant to skip this file.
-	require_once(dirname(__FILE__).'/config/tcpdf_config.php');
+	require_once('/etc/php-tcpdf/tcpdf_config.php');
 }
 
 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -