File: txpath_to_var_lib.patch

package info (click to toggle)
textpattern 4.2.0-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 1,888 kB
  • ctags: 4,970
  • sloc: php: 27,609; sh: 175; makefile: 20
file content (145 lines) | stat: -rw-r--r-- 4,570 bytes parent folder | download
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
Don't let textpattern use __FILE__ hint. Use /var/lib/textpattern
directly instead.

diff --git a/css.php b/css.php
index db2f493..8c62f76 100644
--- a/css.php
+++ b/css.php
@@ -12,7 +12,7 @@ header('Content-type: text/css');
 
 if (!defined("txpath"))
 {
-	define("txpath", dirname(__FILE__).'/textpattern');
+	define("txpath", '/var/lib/textpattern/textpattern');
 }
 
 if (!isset($txpcfg['table_prefix']))
diff --git a/index.php b/index.php
index e2067f3..f7b47de 100644
--- a/index.php
+++ b/index.php
@@ -15,13 +15,13 @@ $LastChangedRevision: 3189 $
 
 	if (!defined('txpath'))
 	{
-		define("txpath", dirname(__FILE__).'/textpattern');
+		define("txpath", '/var/lib/textpattern/textpattern');
 	}
 
 	// save server path to site root
 	if (!isset($here))
 	{
-		$here = dirname(__FILE__);
+		$here = '/var/lib/textpattern';
 	}
 
 	// pull in config unless configuration data has already been provided (multi-headed use).
diff --git a/rpc/index.php b/rpc/index.php
index e03333e..afc4b6f 100644
--- a/rpc/index.php
+++ b/rpc/index.php
@@ -17,7 +17,7 @@ if (@ini_get('register_globals'))
 	foreach ( $_REQUEST as $name => $value )
 		unset($$name);
 
-define('txpath', dirname(dirname(__FILE__)).'/textpattern');
+define('txpath', '/var/lib/textpattern/textpattern');
 define('txpinterface','xmlrpc');
 
 require_once txpath.'/config.php';
diff --git a/sites/site1/admin/setup/index.php b/sites/site1/admin/setup/index.php
index 454b5a7..366a3e9 100644
--- a/sites/site1/admin/setup/index.php
+++ b/sites/site1/admin/setup/index.php
@@ -10,7 +10,7 @@ ob_start(NULL, 2048);
 ob_end_clean();
 
 if (!defined('txpath')) {
-	define("txpath", realpath(dirname(__FILE__).'/../../../../textpattern'));
+	define("txpath", '/var/lib/textpattern/textpattern'));
 }
 
 include txpath.'/setup/index.php';
diff --git a/sites/site1/public/index.php b/sites/site1/public/index.php
index 1098be7..959fb67 100644
--- a/sites/site1/public/index.php
+++ b/sites/site1/public/index.php
@@ -15,7 +15,7 @@ $LastChangedRevision: 3238 $
 
 	if (!defined('txpath'))
 	{
-		define("txpath", realpath(dirname(__FILE__).'/../../../textpattern'));
+		define("txpath", '/var/lib/textpattern/textpattern');
 	}
 
 	// save server path to site root
diff --git a/textpattern/css.php b/textpattern/css.php
index 2936ddd..8a8dabd 100644
--- a/textpattern/css.php
+++ b/textpattern/css.php
@@ -9,7 +9,7 @@ $LastChangedRevision: 3189 $
 
 if (!defined("txpath"))
 {
-	define("txpath", dirname(__FILE__));
+	define("txpath", '/var/lib/textpattern/textpattern');
 }
 
 require_once txpath.'/../css.php';
diff --git a/textpattern/index.php b/textpattern/index.php
index c877a07..e87ca39 100644
--- a/textpattern/index.php
+++ b/textpattern/index.php
@@ -19,7 +19,7 @@ $LastChangedRevision: 3275 $
 
 	if (!defined('txpath'))
 	{
-		define("txpath", dirname(__FILE__));
+		define("txpath", '/var/lib/textpattern/textpattern');
 	}
 
 	define("txpinterface", "admin");
@@ -65,7 +65,7 @@ $LastChangedRevision: 3275 $
 		if (empty($siteurl))
 			$siteurl = $_SERVER['HTTP_HOST'] . rtrim(dirname(dirname($_SERVER['SCRIPT_NAME'])), '/');
 		if (empty($path_to_site))
-			updateSitePath(dirname(dirname(__FILE__)));
+			updateSitePath('/var/lib/textpattern');
 
 		define("LANG",$language);
 		//i18n: define("LANG","en-gb");
diff --git a/textpattern/publish.php b/textpattern/publish.php
index 9f86cbb..b1fefa1 100644
--- a/textpattern/publish.php
+++ b/textpattern/publish.php
@@ -19,7 +19,7 @@ $LastChangedRevision: 3258 $
 */
 
 	if (!defined('txpath'))
-		define("txpath", dirname(__FILE__));
+		define("txpath", '/var/lib/textpattern/textpattern');
 	if (!defined("txpinterface"))
 		die('If you just updated and expect to see your site here, please also update the files in your main installation directory.'.
 			' (Otherwise note that publish.php cannot be called directly.)');
@@ -65,7 +65,7 @@ $LastChangedRevision: 3258 $
 		$prefs['siteurl'] = $siteurl = $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['SCRIPT_NAME']), '/');
 
 	if (empty($path_to_site))
-		updateSitePath(dirname(dirname(__FILE__)));
+		updateSitePath('/var/lib/textpattern');
 
 	if (!defined('PROTOCOL')) {
 		switch (serverSet('HTTPS')) {
diff --git a/textpattern/setup/index.php b/textpattern/setup/index.php
index efcb9aa..e8aa579 100644
--- a/textpattern/setup/index.php
+++ b/textpattern/setup/index.php
@@ -15,7 +15,7 @@ $LastChangedRevision: 3193 $
 
 if (!defined('txpath'))
 {
-	define("txpath", dirname(dirname(__FILE__)));
+	define("txpath", '/var/lib/textpattern/textpattern');
 }
 
 define("txpinterface", "admin");