]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - index.php
additional notes about WIKI_NAME
[SourceForge/phpwiki.git] / index.php
1 <?php // -*-php-*-
2
3 /*
4 Copyright 2000??, 2001, 2002 $ThePhpWikiProgrammingTeam = array(
5 "Steve Wainstead", "Arno Hollosi", "Jeff Dairiki",
6 "Aredridel Niothke", "Jan Nieuwenhuizen", "Sandino Araico Sánchez",
7 "Jon Åslund", "Marco Milanesi", "Carsten Klapp", "Joel Uckelman",
8 "Pablo Roca Rozas", "Scott R. Anderson", "Neil Brown", "Jan Hidders",
9 "Antti Kaihola", "Jeremie Kass", "John Jorgensen", "Tim Voght",
10 "Grant Morgan", "Clifford A. Adams", "Reini Urban");
11
12 This file is part of PhpWiki.
13
14 PhpWiki is free software; you can redistribute it and/or modify
15 it under the terms of the GNU General Public License as published by
16 the Free Software Foundation; either version 2 of the License, or
17 (at your option) any later version.
18
19 PhpWiki is distributed in the hope that it will be useful,
20 but WITHOUT ANY WARRANTY; without even the implied warranty of
21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22 GNU General Public License for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with PhpWiki; if not, write to the Free Software
26 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
27 */
28
29
30 /////////////////////////////////////////////////////////////////////
31 /*
32   This is the starting file for PhpWiki. All this file does is set
33   configuration options, and at the end of the file it includes() the
34   file lib/main.php, where the real action begins.
35
36   This file is divided into six parts: Parts Zero, One, Two, Three,
37   Four and Five. Each one has different configuration settings you can
38   change; in all cases the default should work on your system,
39   however, we recommend you tailor things to your particular setting.
40 */
41
42 /////////////////////////////////////////////////////////////////////
43 // Part Zero: If PHP needs help in finding where you installed the
44 //   rest of the PhpWiki code, you can set the include_path here.
45
46 // NOTE: phpwiki uses the PEAR library of php code for SQL database
47 // access. Your PHP is probably already configured to set
48 // include_path so that PHP can find the pear code. If not (or if you
49 // change include_path here) make sure you include the path to the
50 // PEAR code in include_path. (To find the PEAR code on your system,
51 // search for a file named 'PEAR.php'. Some common locations are:
52 //
53 //   Unixish systems:
54 //     /usr/share/php
55 //     /usr/local/share/php
56 //   Mac OS X:
57 //     /System/Library/PHP
58 //
59 // The above examples are already included by PhpWiki. You shouldn't
60 // have to change this unless you see a WikiFatalError:
61 //
62 //     lib/FileFinder.php:82: Fatal[256]: DB.php: file not found
63 //
64 //ini_set('include_path', '.:/where/you/installed/phpwiki');
65
66 /////////////////////////////////////////////////////////////////////
67 // Part Null: Don't touch this!
68
69 define ('PHPWIKI_VERSION', '1.3.2-jeffs-hacks');
70 require "lib/prepend.php";
71 rcs_id('$Id: index.php,v 1.65 2002-01-17 20:58:40 carstenklapp Exp $');
72
73 /////////////////////////////////////////////////////////////////////
74 //
75 // Part One:
76 // Authentication and security settings:
77 // 
78 /////////////////////////////////////////////////////////////////////
79
80 // The name of your wiki.
81 // This is used to generate a keywords meta tag in the HTML templates,
82 // in bookmark titles for any bookmarks made to pages in your wiki,
83 // and during RSS generation for the <title> of the RSS channel.
84 //define('WIKI_NAME', 'PhpWiki');
85
86 // If set, we will perform reverse dns lookups to try to convert the
87 // users IP number to a host name, even if the http server didn't do
88 // it for us.
89 define('ENABLE_REVERSE_DNS', true);
90
91 // Username and password of administrator.
92 // Set these to your preferences. For heaven's sake
93 // pick a good password!
94 define('ADMIN_USER', "");
95 define('ADMIN_PASSWD', "");
96
97 // If true, only the admin user can make zip dumps, else zip dumps
98 // require no authentication.
99 define('ZIPDUMP_AUTH', false);
100
101 // This setting determines the type of page dumps. Must be one of
102 // "quoted-printable" or "binary".
103 $pagedump_format = "quoted-printable";
104
105 // The maximum file upload size.
106 define('MAX_UPLOAD_SIZE', 16 * 1024 * 1024);
107
108 // If the last edit is older than MINOR_EDIT_TIMEOUT seconds, the
109 // default state for the "minor edit" checkbox on the edit page form
110 // will be off.
111 define("MINOR_EDIT_TIMEOUT", 7 * 24 * 3600);
112
113 // Actions listed in this array will not be allowed.
114 //$DisabledActions = array('dumpserial', 'loadfile');
115
116 // PhpWiki can generate an access_log (in "NCSA combined log" format)
117 // for you. If you want one, define this to the name of the log file.
118 //define('ACCESS_LOG', '/tmp/wiki_access_log');
119
120
121 // If ALLOW_BOGO_LOGIN is true, users are allowed to login (with
122 // any/no password) using any userid which: 1) is not the ADMIN_USER,
123 // 2) is a valid WikiWord (matches $WikiNameRegexp.)
124 define('ALLOW_BOGO_LOGIN', true);
125
126 // The login code now uses PHP's session support. Usually, the default
127 // configuration of PHP is to store the session state information in
128 // /tmp. That probably will work fine, but fails e.g. on clustered
129 // servers where each server has their own distinct /tmp (this is the
130 // case on SourceForge's project web server.) You can specify an
131 // alternate directory in which to store state information like so
132 // (whatever user your httpd runs as must have read/write permission
133 // in this directory):
134
135 //ini_set('session.save_path', 'some_other_directory');
136
137
138 /////////////////////////////////////////////////////////////////////
139 //
140 // Part Two:
141 // Database Selection
142 //
143 /////////////////////////////////////////////////////////////////////
144
145 //
146 // This array holds the parameters which select the database to use.
147 //
148 // Not all of these parameters are used by any particular DB backend.
149 //
150 $DBParams = array(
151    // Select the database type:
152    //'dbtype' => 'SQL',
153    'dbtype'   => 'dba',
154    
155    // For SQL based backends, specify the database as a DSN
156    // The most general form of a DSN looks like:
157    //
158    //   phptype(dbsyntax)://username:password@protocol+hostspec/database
159    //
160    // For a MySQL database, the following should work:
161    //
162    //   mysql://user:password@host/databasename
163    //
164    // FIXME: My version Pear::DB seems to be broken enough that there
165    //        is no way to connect to a mysql server over a socket right now.
166    //'dsn' => 'mysql://guest@:/var/lib/mysql/mysql.sock/test',
167    //'dsn' => 'mysql://guest@localhost/test',
168    //'dsn' => 'pgsql://localhost/test',
169    
170    // Used by all DB types:
171
172    // prefix for filenames or table names
173    /* 
174     * currently you MUST EDIT THE SQL file too (in the schemas/
175     * directory because we aren't doing on the fly sql generation
176     * during the installation.
177    */
178    //'prefix' => 'phpwiki_',
179    
180    // Used by 'dba'
181    'directory'     => "/tmp",
182    'dba_handler'   => 'gdbm',   // Either of 'gdbm' or 'db2' work great for me.
183    //'dba_handler' => 'db2',
184    //'dba_handler' => 'db3',    // doesn't work at all for me....
185    'timeout'   => 20,
186    //'timeout' => 5
187 );
188
189 /////////////////////////////////////////////////////////////////////
190 //
191 // The next section controls how many old revisions of each page are
192 // kept in the database.
193 //
194 // There are two basic classes of revisions: major and minor. Which
195 // class a revision belongs in is determined by whether the author
196 // checked the "this is a minor revision" checkbox when they saved the
197 // page.
198 // 
199 // There is, additionally, a third class of revisions: author
200 // revisions. The most recent non-mergable revision from each distinct
201 // author is and author revision.
202 //
203 // The expiry parameters for each of those three classes of revisions
204 // can be adjusted seperately. For each class there are five
205 // parameters (usually, only two or three of the five are actually
206 // set) which control how long those revisions are kept in the
207 // database.
208 //
209 //   max_keep: If set, this specifies an absolute maximum for the
210 //             number of archived revisions of that class. This is
211 //             meant to be used as a safety cap when a non-zero
212 //             min_age is specified. It should be set relatively high,
213 //             and it's purpose is to prevent malicious or accidental
214 //             database overflow due to someone causing an
215 //             unreasonable number of edits in a short period of time.
216 //
217 //   min_age:  Revisions younger than this (based upon the supplanted
218 //             date) will be kept unless max_keep is exceeded. The age
219 //             should be specified in days. It should be a
220 //             non-negative, real number,
221 //
222 //   min_keep: At least this many revisions will be kept.
223 //
224 //   keep:     No more than this many revisions will be kept.
225 //
226 //   max_age:  No revision older than this age will be kept.
227 //
228 // Supplanted date: Revisions are timestamped at the instant that they
229 // cease being the current revision. Revision age is computed using
230 // this timestamp, not the edit time of the page.
231 //
232 // Merging: When a minor revision is deleted, if the preceding
233 // revision is by the same author, the minor revision is merged with
234 // the preceding revision before it is deleted. Essentially: this
235 // replaces the content (and supplanted timestamp) of the previous
236 // revision with the content after the merged minor edit, the rest of
237 // the page metadata for the preceding version (summary, mtime, ...)
238 // is not changed.
239 //
240 // Keep up to 8 major edits, but keep them no longer than a month.
241 $ExpireParams['major'] = array('max_age' => 32,
242                                'keep'    => 8);
243 // Keep up to 4 minor edits, but keep them no longer than a week.
244 $ExpireParams['minor'] = array('max_age' => 7,
245                                'keep'    => 4);
246 // Keep the latest contributions of the last 8 authors up to a year.
247 // Additionally, (in the case of a particularly active page) try to
248 // keep the latest contributions of all authors in the last week (even
249 // if there are more than eight of them,) but in no case keep more
250 // than twenty unique author revisions.
251 $ExpireParams['author'] = array('max_age'  => 365,
252                                 'keep'     => 8,
253                                 'min_age'  => 7,
254                                 'max_keep' => 20);
255
256 /////////////////////////////////////////////////////////////////////
257 // 
258 // Part Three:
259 // Page appearance and layout
260 //
261 /////////////////////////////////////////////////////////////////////
262
263 /* THEME
264  *
265  * Most of the page appearance is controlled by files in the theme
266  * subdirectory.
267  *
268  * There are a number of pre-defined themes shipped with PhpWiki.
269  * Or you may create your own (e.g. by copying and then modifying one of
270  * stock themes.)
271  *
272  * Pick one.
273  */
274 //define('THEME', 'default');
275 //define('THEME', 'Hawaiian');
276 //define('THEME', 'MacOSX');
277 //define('THEME', 'WikiTrek');
278
279 // Select a valid charset name to be inserted into the xml/html pages,
280 // and to reference links to the stylesheets (css). For more info see:
281 // <http://www.iana.org/assignments/character-sets>. Note that PhpWiki
282 // has been extensively tested only with the latin1 (iso-8859-1)
283 // character set.
284 //
285 // If you change the default from iso-8859-1 PhpWiki may not work
286 // properly and it will require code modifications. However, character
287 // sets similar to iso-8859-1 may work with little or no modification
288 // depending on your setup. The database must also support the same
289 // charset, and of course the same is true for the web browser. (Some
290 // work is in progress hopefully to allow more flexibility in this
291 // area in the future).
292 define("CHARSET", "iso-8859-1");
293
294 // Select your language/locale - default language is "C" for English.
295 // Other languages available:
296 // English "C"  (English    - HomePage)
297 // Dutch   "nl" (Nederlands - ThuisPagina)
298 // Spanish "es" (Español    - PáginaPrincipal)
299 // French  "fr" (Français   - Accueil)
300 // German  "de" (Deutsch    - StartSeite)
301 // Swedish "sv" (Svenska    - Framsida)
302 // Italian "it" (Italiano   - PaginaPrincipale)
303 //
304 // If you set $LANG to the empty string, your systems default language
305 // (as determined by the applicable environment variables) will be
306 // used.
307 //
308 // Note that on some systems, apprently using these short forms for
309 // the locale won't work. On my home system 'LANG=de' won't result in
310 // german pages. Somehow the system must recognize the locale as a
311 // valid locale before gettext() will work, i.e., use 'de_DE',
312 // 'nl_NL'.
313 $LANG='C';
314 //$LANG='nl_NL';
315
316 // Setting the LANG environment variable (accomplished above) may or
317 // may not be sufficient to cause PhpWiki to produce dates in your
318 // native language. (It depends on the configuration of the operating
319 // system on your http server.)  The problem is that, e.g. 'de' is
320 // often not a valid locale.
321 //
322 // A standard locale name is typically of  the  form
323 // language[_territory][.codeset][@modifier],  where  language is
324 // an ISO 639 language code, territory is an ISO 3166 country code,
325 // and codeset  is  a  character  set or encoding identifier like
326 // ISO-8859-1 or UTF-8.
327 //
328 // You can tailor the locale used for time and date formatting by
329 // setting the LC_TIME environment variable. You'll have to experiment
330 // to find the correct setting:
331 //putenv('LC_TIME=de_DE');
332
333
334 /* WIKI_PGSRC -- specifies the source for the initial page contents of
335  * the Wiki. The setting of WIKI_PGSRC only has effect when the wiki is
336  * accessed for the first time (or after clearing the database.)
337  * WIKI_PGSRC can either name a directory or a zip file. In either case
338  * WIKI_PGSRC is scanned for files -- one file per page.
339  */
340 define('WIKI_PGSRC', "pgsrc"); // Default (old) behavior.
341 //define('WIKI_PGSRC', 'wiki.zip'); // New style.
342 //define('WIKI_PGSRC', '../../../Logs/Hamwiki/hamwiki-20010830.zip'); // New style.
343
344 /*
345  * DEFAULT_WIKI_PGSRC is only used when the language is *not* the
346  * default (English) and when reading from a directory: in that case
347  * some English pages are inserted into the wiki as well.
348  * DEFAULT_WIKI_PGSRC defines where the English pages reside.
349  */
350 // FIXME: is this really needed?  Can't we just copy these pages into
351 // the localized pgsrc?
352 define('DEFAULT_WIKI_PGSRC', "pgsrc");
353 // These are the pages which will get loaded from DEFAULT_WIKI_PGSRC.   
354 $GenericPages = array("ReleaseNotes", "SteveWainstead", "TestPage");
355
356 /////////////////////////////////////////////////////////////////////
357 //
358 // Part four:
359 // Mark-up options.
360 // 
361 /////////////////////////////////////////////////////////////////////
362
363 // allowed protocols for links - be careful not to allow "javascript:"
364 // URL of these types will be automatically linked.
365 // within a named link [name|uri] one more protocol is defined: phpwiki
366 $AllowedProtocols = "http|https|mailto|ftp|news|nntp|ssh|gopher";
367
368 // URLs ending with the following extension should be inlined as images
369 $InlineImages = "png|jpg|gif|tiff|tif";
370
371 // Uncomment this to automatically split WikiWords by inserting spaces.
372 // The default is to leave WordsSmashedTogetherLikeSo in the body text.
373 //define("autosplit_wikiwords", 1);
374
375 // Perl regexp for WikiNames ("bumpy words")
376 // (?<!..) & (?!...) used instead of '\b' because \b matches '_' as well
377 $WikiNameRegexp = "(?<![[:alnum:]])([[:upper:]][[:lower:]]+){2,}(?![[:alnum:]])";
378
379 // InterWiki linking -- wiki-style links to other wikis on the web
380 //
381 // Intermap file for InterWikiLinks -- define other wikis there
382 // Leave this undefined to disable InterWiki linking.
383 define('INTERWIKI_MAP_FILE', "lib/interwiki.map");
384
385
386 /////////////////////////////////////////////////////////////////////
387 //
388 // Part five:
389 // URL options -- you can probably skip this section.
390 //
391 /////////////////////////////////////////////////////////////////////
392 /******************************************************************
393  *
394  * The following section contains settings which you can use to tailor
395  * the URLs which PhpWiki generates.
396  *
397  * Any of these parameters which are left undefined will be deduced
398  * automatically. You need only set them explicitly if the
399  * auto-detected values prove to be incorrect.
400  *
401  * In most cases the auto-detected values should work fine, so
402  * hopefully you don't need to mess with this section.
403  *
404  ******************************************************************/
405
406 /*
407  * Canonical name and httpd port of the server on which this PhpWiki
408  * resides.
409  */
410 //define('SERVER_NAME', 'some.host.com');
411 //define('SERVER_PORT', 80);
412
413 /*
414  * Relative URL (from the server root) of the PhpWiki
415  * script.
416  */
417 //define('SCRIPT_NAME', '/some/where/index.php');
418
419 /*
420  * Relative URL (from the server root) of the directory from which
421  * other relative URL's for images and other support files are
422  * interpreted.
423  */
424 //define('DATA_PATH', '/some/where');
425
426 /*
427  * Define to 'true' to use PATH_INFO to pass the pagename's.
428  * e.g. http://www.some.where/index.php/HomePage instead
429  * of http://www.some.where/index.php?pagename=HomePage
430  * FIXME: more docs (maybe in README).
431  */
432 //define('USE_PATH_INFO', false);
433
434 /*
435  * VIRTUAL_PATH is the canonical URL path under which your your wiki
436  * appears. Normally this is the same as dirname(SCRIPT_NAME), however
437  * using, e.g. apaches mod_actions (or mod_rewrite), you can make it
438  * something different.
439  *
440  * If you do this, you should set VIRTUAL_PATH here.
441  *
442  * E.g. your phpwiki might be installed at at /scripts/phpwiki/index.php,
443  * but  * you've made it accessible through eg. /wiki/HomePage.
444  *
445  * One way to do this is to create a directory named 'wiki' in your
446  * server root. The directory contains only one file: an .htaccess
447  * file which reads something like:
448  *
449  *    Action x-phpwiki-page /scripts/phpwiki/index.php
450  *    SetHandler x-phpwiki-page
451  *    DirectoryIndex /scripts/phpwiki/index.php
452  *
453  * In that case you should set VIRTUAL_PATH to '/wiki'.
454  *
455  * (VIRTUAL_PATH is only used if USE_PATH_INFO is true.)
456  */
457 //define('VIRTUAL_PATH', '/SomeWiki');
458
459
460 ////////////////////////////////////////////////////////////////
461 // Okay... fire up the code:
462 ////////////////////////////////////////////////////////////////
463
464 include "lib/main.php";
465
466 // (c-file-style: "gnu")
467 // Local Variables:
468 // mode: php
469 // tab-width: 8
470 // c-basic-offset: 4
471 // c-hanging-comment-ender-p: nil
472 // indent-tabs-mode: nil
473 // End:   
474 ?>