]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - index.php
include_path independency
[SourceForge/phpwiki.git] / index.php
1 <?php // -*-php-*-
2 // iso-8859-1
3
4 // IMPORTANT NOTE: Use of the ***configurator.php*** to generate an
5 // index.php is depreciated, because it is out of date and a new
6 // configuration system is in the works (see the config directory, not
7 // finished yet though). DO compare or diff the configurator's output
8 // against this file if you feel you must use it to generate an
9 // index.php!
10
11 /*
12 Copyright 1999,2000,2001,2002,2003,2004 $ThePhpWikiProgrammingTeam 
13 = array(
14 "Steve Wainstead", "Clifford A. Adams", "Lawrence Akka", 
15 "Scott R. Anderson", "Jon Åslund", "Neil Brown", "Jeff Dairiki",
16 "Stéphane Gourichon", "Jan Hidders", "Arno Hollosi", "John Jorgensen",
17 "Antti Kaihola", "Jeremie Kass", "Carsten Klapp", "Marco Milanesi",
18 "Grant Morgan", "Jan Nieuwenhuizen", "Aredridel Niothke", 
19 "Pablo Roca Rozas", "Sandino Araico Sánchez", "Joel Uckelman", 
20 "Reini Urban", "Joby Walker", "Tim Voght", "Jochen Kalmbach");
21
22 This file is part of PhpWiki.
23
24 PhpWiki is free software; you can redistribute it and/or modify
25 it under the terms of the GNU General Public License as published by
26 the Free Software Foundation; either version 2 of the License, or
27 (at your option) any later version.
28
29 PhpWiki is distributed in the hope that it will be useful,
30 but WITHOUT ANY WARRANTY; without even the implied warranty of
31 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
32 GNU General Public License for more details.
33
34 You should have received a copy of the GNU General Public License
35 along with PhpWiki; if not, write to the Free Software
36 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
37 */
38
39 require_once (dirname(__FILE__).'/lib/prepend.php');
40 rcs_id('$Id: index.php,v 1.142 2004-04-26 12:16:40 rurban Exp $');
41
42 require_once(dirname(__FILE__).'/lib/IniConfig.php');
43 IniConfig(dirname(__FILE__)."/config/config.ini");
44
45 //if (defined('WIKI_SOAP') and WIKI_SOAP) return;
46
47 ////////////////////////////////////////////////////////////////
48 // PrettyWiki
49 // Check if we were included by some other wiki version 
50 // (getimg.php, en, de, wiki, ...) or not. 
51 // If the server requested this index.php fire up the code by loading lib/main.php.
52 // Parallel wiki scripts can now simply include /index.php for the 
53 // main configuration, extend or redefine some settings and 
54 // load lib/main.php by themselves. See the file 'wiki'.
55 // This overcomes the IndexAsConfigProblem.
56 // Generally a simple 
57 //   define('VIRTUAL_PATH', $_SERVER['SCRIPT_NAME']);
58 // is enough in the wiki file, plus the action definition in a .htaccess file
59 ////////////////////////////////////////////////////////////////
60
61 // If your lib/main.php is not loaded, comment that out, and  
62 // uncomment the include "lib/main.php" line below.
63 if (defined('VIRTUAL_PATH') and defined('USE_PATH_INFO')) {
64     if ($HTTP_SERVER_VARS['SCRIPT_NAME'] != VIRTUAL_PATH) {
65         include(dirname(__FILE__)."/lib/main.php");
66     }
67     elseif (defined('SCRIPT_NAME') and 
68             ($HTTP_SERVER_VARS['SCRIPT_NAME'] != SCRIPT_NAME)) {
69         include(dirname(__FILE__)."/lib/main.php");
70     }
71 } else {
72     if (defined('SCRIPT_NAME') and 
73         ($HTTP_SERVER_VARS['SCRIPT_NAME'] == SCRIPT_NAME)) {
74         include(dirname(__FILE__)."/lib/main.php");
75     } elseif (strstr($HTTP_SERVER_VARS['PHP_SELF'],'index.php')) {
76         include(dirname(__FILE__)."/lib/main.php");
77     }
78 }
79 //include(dirname(__FILE__)."/lib/main.php");
80
81 // $Log: not supported by cvs2svn $
82 // Revision 1.141  2004/04/19 23:13:02  zorloc
83 // Connect the rest of PhpWiki to the IniConfig system.  Also the keyword regular expression is not a config setting
84 //
85 // Revision 1.140  2004/04/12 18:29:12  rurban
86 // exp. Session auth for already authenticated users from another app
87 //
88 // Revision 1.139  2004/04/12 16:24:28  rurban
89 // 1.3.10pre, JS_SEARCHREPLACE => pref option
90 //
91 // Revision 1.138  2004/04/12 12:27:07  rurban
92 // more notes and themes
93 //
94 // Revision 1.137  2004/04/11 10:42:02  rurban
95 // pgsrc/CreatePagePlugin
96 //
97 // Revision 1.136  2004/04/10 04:14:13  rurban
98 // sf.net 906436 Suggestion
99 //
100 // Revision 1.135  2004/04/10 03:33:03  rurban
101 // Oops revert
102 //
103 // Revision 1.134  2004/04/10 02:55:48  rurban
104 // fixed old WikiUser
105 //
106 // Revision 1.133  2004/04/08 01:22:53  rurban
107 // fixed PageChange Notification
108 //
109 // Revision 1.132  2004/04/01 15:57:10  rurban
110 // simplified Sidebar theme: table, not absolute css positioning
111 // added the new box methods.
112 // remaining problems: large left margin, how to override _autosplitWikiWords in Template only
113 //
114 // Revision 1.131  2004/03/14 16:24:35  rurban
115 // authenti(fi)cation spelling
116 //
117 // Revision 1.130  2004/03/09 17:16:43  rurban
118 // fixed $LDAP_SET_OPTION
119 //
120 // Revision 1.129  2004/02/29 04:10:55  rurban
121 // new POP3 auth (thanks to BiloBilo: pentothal at despammed dot com)
122 // fixed syntax error in index.php
123 //
124 // Revision 1.128  2004/02/29 02:06:05  rurban
125 // And this is the SOAP server. Just a view methods for now. (page content)
126 // I would like to see common-wiki soap wdsl.
127 //
128 // "SOAP is a bloated, over engineered mess of a perfectly trivial concept. Sigh."
129 //   -- http://www.wlug.org.nz/SOAP
130 //
131 // Revision 1.127  2004/02/28 21:18:29  rurban
132 // new SQL auth_create, don't ever use REPLACE sql calls!
133 // moved HttpAuth to the end of the chain
134 // PrettyWiki enabled again
135 //
136 // Revision 1.126  2004/02/27 16:27:48  rurban
137 // REPLACE is a dirty hack, and erases passwd btw.
138 //
139 // Revision 1.125  2004/02/24 02:51:57  rurban
140 // release 1.3.8 ready
141 //
142 // Revision 1.124  2004/02/16 00:20:30  rurban
143 // new Japanses language
144 //
145 // Revision 1.123  2004/02/09 03:58:07  rurban
146 // for now default DB_SESSION to false
147 // PagePerm:
148 //   * not existing perms will now query the parent, and not
149 //     return the default perm
150 //   * added pagePermissions func which returns the object per page
151 //   * added getAccessDescription
152 // WikiUserNew:
153 //   * added global ->prepare (not yet used) with smart user/pref/member table prefixing.
154 //   * force init of authdbh in the 2 db classes
155 // main:
156 //   * fixed session handling (not triple auth request anymore)
157 //   * don't store cookie prefs with sessions
158 // stdlib: global obj2hash helper from _AuthInfo, also needed for PagePerm
159 //
160 // Revision 1.122  2004/02/07 14:20:18  rurban
161 // consistent mysql schema with index.php (userid)
162 //
163 // Revision 1.121  2004/02/07 10:41:25  rurban
164 // fixed auth from session (still double code but works)
165 // fixed GroupDB
166 // fixed DbPassUser upgrade and policy=old
167 // added GroupLdap
168 //
169 // Revision 1.120  2004/02/03 09:45:39  rurban
170 // LDAP cleanup, start of new Pref classes
171 //
172 // Revision 1.119  2004/02/01 09:14:10  rurban
173 // Started with Group_Ldap (not yet ready)
174 // added new _AuthInfo plugin to help in auth problems (warning: may display passwords)
175 // fixed some configurator vars
176 // renamed LDAP_AUTH_SEARCH to LDAP_BASE_DN
177 // changed PHPWIKI_VERSION from 1.3.8a to 1.3.8pre
178 // USE_DB_SESSION defaults to true on SQL
179 // changed GROUP_METHOD definition to string, not constants
180 // changed sample user DBAuthParams from UPDATE to REPLACE to be able to
181 //   create users. (Not to be used with external databases generally, but
182 //   with the default internal user table)
183 //
184 // fixed the IndexAsConfigProblem logic. this was flawed:
185 //   scripts which are the same virtual path defined their own lib/main call
186 //   (hmm, have to test this better, phpwiki.sf.net/demo works again)
187 //
188 // Revision 1.118  2004/01/28 14:34:13  rurban
189 // session table takes the common prefix
190 // + various minor stuff
191 // reallow password changing
192 //
193 // Revision 1.117  2004/01/27 23:25:50  rurban
194 // added new tables to mysql schema
195 // fixed default DBAUthParam samples to match these
196 // added group constants (look terrible, I'd prefer strings instead of constants)
197 //
198 // Revision 1.116  2004/01/25 04:21:02  rurban
199 // WikiUserNew support (temp. ENABLE_USER_NEW constant)
200 //
201 // Revision 1.115  2003/12/22 04:58:11  carstenklapp
202 // Incremented release version.
203 //
204 // Revision 1.114  2003/12/05 16:00:42  carstenklapp
205 // ACK! gettext is not available at this point in index.php.
206 //
207 // Revision 1.113  2003/12/05 15:51:37  carstenklapp
208 // Added note that use of the configurator is depreciated.
209 //
210 // Enable localization/gettextification of $KeywordLinkRegexp. (Also, now
211 // users not familiar with regex can more easily just edit the $keywords
212 // array).
213 //
214 // Added four new constants to define author and copyright link rel~s
215 // used in html head. This makes it easier to run multiple wikis off of
216 // one set of code.
217 //
218 // Eliminated RECENT_CHANGES constant for RSS auto discovery because it's
219 // another step to watch out for when running a non-english wiki. Now
220 // simply defined as _("RecentChanges") in head.tmpl itself. Non-standard
221 // wikis where the RecentChanges page has been named to something else
222 // will have to modify this in head.tmpl (along with all other places the
223 // word RecentChanges appears in the code, something that already would
224 // have had to be done on such a wiki anyway).
225 //
226 // Added a little more info and instructions to flesh out:
227 // DEBUG, WIKI_NAME, ADMIN_USER, $DisabledActions, $DBParams, CHARSET.
228 //
229 // A few typos and spelling mistakes corrected, and some text rewrapped.
230 //
231 // Revision 1.112  2003/11/17 15:49:21  carstenklapp
232 // Updated version number to 1.3.7pre (beyond current release
233 // 1.3.6). Disabled DEBUG output by default (hide DebugInfo, XHTML &
234 // CSS validator buttons). Note the DebugInfo button remains visible
235 // for the Admin, and can be accessed by anyone else by adding
236 // "?action=DebugInfo" to the URL for the occasional use.
237 //
238 // Revision 1.111  2003/03/18 21:40:04  dairiki
239 // Copy Lawrence's memo on USE_PATH_INFO/AcceptPathInfo to configurator.php
240 // (as promised).
241 //
242 // Plus slight clarification of default (auto-detect) behavior.
243 //
244 // Revision 1.110  2003/03/18 20:51:10  lakka
245 // Revised comments on use of USE_PATH_INFO with Apache 2
246 //
247 // Revision 1.109  2003/03/17 21:24:50  dairiki
248 // Fix security bugs in the RawHtml plugin.
249 //
250 // Change the default configuration to allow use of plugin, since
251 // I believe the plugin is now safe for general use. (Raw HTML will only
252 // work on locked pages.)
253 //
254 // Revision 1.108  2003/03/07 22:47:01  dairiki
255 // A few more if(!defined(...))'s
256 //
257 // Revision 1.107  2003/03/07 20:51:54  dairiki
258 // New feature: Automatic extraction of keywords (for the meta keywords tag)
259 // from Category* and Topic* links on each page.
260 //
261 // Revision 1.106  2003/03/07 02:48:23  dairiki
262 // Add option to prevent HTTP redirect.
263 //
264 // Revision 1.105  2003/03/04 02:08:08  dairiki
265 // Fix and document the WIKIDB_NOCACHE_MARKUP config define.
266 //
267 // Revision 1.104  2003/02/26 02:55:52  dairiki
268 // New config settings in index.php to control cache control strictness.
269 //
270 // Revision 1.103  2003/02/22 19:43:50  dairiki
271 // Fix comment regarding connecting to SQL server over a unix socket.
272 //
273 // Revision 1.102  2003/02/22 18:53:38  dairiki
274 // Renamed method Request::compress_output to Request::buffer_output.
275 //
276 // Added config option to disable compression.
277 //
278 // Revision 1.101  2003/02/21 19:29:30  dairiki
279 // Update PHPWIKI_VERSION to 1.3.5pre.
280 //
281 // Revision 1.100  2003/01/04 03:36:58  wainstead
282 // Added 'file' as a database type alongside 'dbm'; added cvs log tag
283 //
284
285 // (c-file-style: "gnu")
286 // Local Variables:
287 // mode: php
288 // tab-width: 8
289 // c-basic-offset: 4
290 // c-hanging-comment-ender-p: nil
291 // indent-tabs-mode: nil
292 // End:   
293 ?>