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