4 This is the starting file for PhpWiki. All this file does
5 is set configuration options, and at the end of the file
6 it includes() the file lib/main.php, where the real action begins.
8 This file is divided into six parts: Parts Zero, One, Two, Three,
9 Four and Five. Each one has different configuration settings you
10 can change; in all cases the default should work on your system,
11 however, we recommend you tailor things to your particular setting.
14 /////////////////////////////////////////////////////////////////////
15 // Part Zero: If PHP needs help in finding where you installed the
16 // rest of the PhpWiki code, you can set the include_path here.
18 // NOTE: phpwiki uses the PEAR library of php code for SQL database
19 // access. Your PHP is probably already configured to set include_path
20 // so that PHP can find the pear code. If not (or if you change
21 // include_path here) make sure you include the path to the PEAR
22 // code in include_path. (To find the PEAR code on your system, search
23 // for a file named 'PEAR.php'. Some common locations are:
27 // /usr/local/share/php
29 // /System/Library/PHP
31 //ini_set('include_path', '.:/where/you/installed/phpwiki');
33 /////////////////////////////////////////////////////////////////////
34 // Part Null: Don't touch this!
36 define ('PHPWIKI_VERSION', '1.3.0-jeffs-hacks');
37 require "lib/prepend.php";
38 rcs_id('$Id: index.php,v 1.33 2001-12-06 08:15:38 carstenklapp Exp $');
40 /////////////////////////////////////////////////////////////////////
43 // Authentication and security settings:
45 /////////////////////////////////////////////////////////////////////
47 // If set, we will perform reverse dns lookups to try to convert the users
48 // IP number to a host name, even if the http server didn't do it for us.
49 define('ENABLE_REVERSE_DNS', true);
51 // Username and password of administrator.
52 // Set these to your preferences. For heaven's sake
53 // pick a good password!
54 define('ADMIN_USER', "");
55 define('ADMIN_PASSWD', "");
57 // If true, only the admin user can make zip dumps, else
58 // zip dumps require no authentication.
59 define('ZIPDUMP_AUTH', false);
61 // The maximum file upload size.
62 define('MAX_UPLOAD_SIZE', 16 * 1024 * 1024);
64 // If the last edit is older than MINOR_EDIT_TIMEOUT seconds, the default
65 // state for the "minor edit" checkbox on the edit page form will be off.
66 define("MINOR_EDIT_TIMEOUT", 7 * 24 * 3600);
68 // Actions listed in this array will not be allowed.
69 //$DisabledActions = array('dumpserial', 'loadfile');
71 // PhpWiki can generate an access_log (in "NCSA combined log" format)
72 // for you. If you want one, define this to the name of the log file.
73 define('ACCESS_LOG', '/tmp/wiki_access_log');
76 // If ALLOW_BOGO_LOGIN is true, users are allowed to login
77 // (with any/no password) using any userid which: 1) is not
78 // the ADMIN_USER, 2) is a valid WikiWord (matches $WikiNameRegexp.)
79 define('ALLOW_BOGO_LOGIN', true);
81 // The login code now uses PHP's session support. Usually, the default
82 // configuration of PHP is to store the session state information in
83 // /tmp. That probably will work fine, but fails e.g. on clustered
84 // servers where each server has their own distinct /tmp (this
85 // is the case on SourceForge's project web server.) You can specify
86 // an alternate directory in which to store state information like so
87 // (whatever user your httpd runs as must have read/write permission
88 // in this directory):
90 // ini_set('session.save_path', 'some_other_directory');
93 /////////////////////////////////////////////////////////////////////
98 /////////////////////////////////////////////////////////////////////
101 // This array holds the parameters which select the database to use.
103 // Not all of these parameters are used by any particular DB backend.
106 // Select the database type:
110 // For SQL based backends, specify the database as a DSN
111 // The most general form of a DSN looks like:
113 // phptype(dbsyntax)://username:password@protocol+hostspec/database
115 // For a MySQL database, the following should work:
117 // mysql://user:password@host/databasename
119 // FIXME: My version Pear::DB seems to be broken enough that there is
120 // no way to connect to a mysql server over a socket right now.
121 //'dsn' => 'mysql://guest@:/var/lib/mysql/mysql.sock/test',
122 //'dsn' => 'mysql://guest@localhost/test',
123 'dsn' => 'pgsql://localhost/test',
125 // Used by all DB types:
127 // prefix for filenames or table names
129 * currently you MUST EDIT THE SQL file too (in the schemas/ directory
130 * because we aren't doing on the fly sql generation during the
133 //'prefix' => 'phpwiki_',
136 'directory' => "/tmp",
137 'dba_handler' => 'gdbm', // Either of 'gdbm' or 'db2' work great for me.
138 //'dba_handler' => 'db2',
139 //'dba_handler' => 'db3', // doesn't work at all for me....
144 /////////////////////////////////////////////////////////////////////
146 // The next section controls how many old revisions of each page
147 // are kept in the database.
149 // There are two basic classes of revisions: major and minor.
150 // Which class a revision belongs in is determined by whether the
151 // author checked the "this is a minor revision" checkbox when they
154 // There is, additionally, a third class of revisions: author revisions.
155 // The most recent non-mergable revision from each distinct author is
156 // and author revision.
158 // The expiry parameters for each of those three classes of revisions
159 // can be adjusted seperately. For each class there are five
160 // parameters (usually, only two or three of the five are actually set)
161 // which control how long those revisions are kept in the database.
163 // max_keep: If set, this specifies an absolute maximum for the number
164 // of archived revisions of that class. This is meant to be
165 // used as a safety cap when a non-zero min_age is specified.
166 // It should be set relatively high, and it's purpose is to
167 // prevent malicious or accidental database overflow due
168 // to someone causing an unreasonable number of edits in a short
171 // min_age: Revisions younger than this (based upon the supplanted date)
172 // will be kept unless max_keep is exceeded. The age should
173 // be specified in days. It should be a non-negative,
176 // min_keep: At least this many revisions will be kept.
178 // keep: No more than this many revisions will be kept.
180 // max_age: No revision older than this age will be kept.
182 // Supplanted date: Revisions are timestamped at the instant that they cease
183 // being the current revision. Revision age is computed using this timestamp,
184 // not the edit time of the page.
186 // Merging: When a minor revision is deleted, if the preceding revision is by
187 // the same author, the minor revision is merged with the preceding revision
188 // before it is deleted. Essentially: this replaces the content (and supplanted
189 // timestamp) of the previous revision with the content after the merged minor
190 // edit, the rest of the page metadata for the preceding version (summary, mtime, ...)
193 // Keep up to 8 major edits, but keep them no longer than a month.
194 $ExpireParams['major'] = array('max_age' => 32,
196 // Keep up to 4 minor edits, but keep them no longer than a week.
197 $ExpireParams['minor'] = array('max_age' => 7,
199 // Keep the latest contributions of the last 8 authors up to a year.
200 // Additionally, (in the case of a particularly active page) try to keep the
201 // latest contributions of all authors in the last week (even if there are
202 // more than eight of them,) but in no case keep more than twenty unique
204 $ExpireParams['author'] = array('max_age' => 365,
209 /////////////////////////////////////////////////////////////////////
212 // Page appearance and layout
214 /////////////////////////////////////////////////////////////////////
216 // Select your language/locale - default language "C": English
217 // other languages available: Dutch "nl", Spanish "es", German "de",
218 // Swedish "sv", and Italian, "it".
220 // If you set $LANG to the empty string, your systems default
221 // language (as determined by the applicable environment variables)
224 // Note that on some systems, apprently using these short forms for
225 // the locale won't work. On my home system 'LANG=de' won't result
226 // in german pages. Somehow the system must recognize the locale
227 // as a valid locale before gettext() will work, i.e., use 'de_DE',
232 // Setting the LANG environment variable (accomplished above) may or
233 // may not be sufficient to cause PhpWiki to produce dates in your
234 // native language. (It depends on the configuration of the operating
235 // system on your http server.) The problem is that, e.g. 'de' is
236 // often not a valid locale.
238 // A standard locale name is typically of the form
239 // language[_territory][.codeset][@modifier], where language is
240 // an ISO 639 language code, territory is an ISO 3166 country code,
241 // and codeset is a character set or encoding identifier like
242 // ISO-8859-1 or UTF-8.
244 // You can tailor the locale used for time and date formatting by setting
245 // the LC_TIME environment variable. You'll have to experiment to find
246 // the correct setting:
247 //putenv('LC_TIME=de_DE');
249 // If you specify a relative URL for the CSS and images,
250 // the are interpreted relative to DATA_PATH (see below).
251 // (The default value of DATA_PATH is the directory in which
252 // index.php (this file) resides.)
256 // Note that if you use the stock phpwiki style sheet, 'phpwiki.css',
257 // you should make sure that it's companion 'phpwiki-heavy.css'
258 // is installed in the same directory that the base style file is.
259 define("CSS_URL", "phpwiki.css");
261 // logo image (path relative to index.php)
262 $logo = "images/wikibase.png";
264 // Signature image which is shown after saving an edited page
265 // If this is left blank (or unset), the signature will be omitted.
266 //$SignatureImg = "images/signature.png";
268 // this turns on url indicator icons, inserted before embedded links
269 //define("USE_LINK_ICONS", 1);
271 // Date & time formats used to display modification times, etc.
272 // Formats are given as format strings to PHP strftime() function
273 // See http://www.php.net/manual/en/function.strftime.php for details.
274 $datetimeformat = "%B %e, %Y"; // may contain time of day
275 $dateformat = "%B %e, %Y"; // must not contain time
278 // this defines how many page names to list when displaying
279 // the MostPopular pages; the default is to show the 20 most popular pages
280 define("MOST_POPULAR_LIST_LENGTH", 20);
282 // this defines how many page names to list when displaying related pages
283 define("NUM_RELATED_PAGES", 5);
285 // Template files (filenames are relative to script position)
286 // However, if a LANG is set, they we be searched for in a locale
287 // specific location first.
288 $templates = array("BROWSE" => "templates/browse.html",
289 "EDITPAGE" => "templates/editpage.html",
290 "MESSAGE" => "templates/message.html");
292 // The themeinfo file can be used to override default settings above this line
293 // (i.e. templates, logo, signature etc.)
295 if ( !$theme == "" ) {
296 if ( file_exists( "themes/$theme/themeinfo.php" ) ) {
297 include "themes/$theme/themeinfo.php";
301 /* WIKI_PGSRC -- specifies the source for the initial page contents
302 * of the Wiki. The setting of WIKI_PGSRC only has effect when
303 * the wiki is accessed for the first time (or after clearing the
304 * database.) WIKI_PGSRC can either name a directory or a zip file.
305 * In either case WIKI_PGSRC is scanned for files --- one file per page.
307 define('WIKI_PGSRC', "pgsrc"); // Default (old) behavior.
308 //define('WIKI_PGSRC', 'wiki.zip'); // New style.
309 //define('WIKI_PGSRC', '../../../Logs/Hamwiki/hamwiki-20010830.zip'); // New style.
311 // DEFAULT_WIKI_PGSRC is only used when the language is *not*
312 // the default (English) and when reading from a directory:
313 // in that case some English pages are inserted into the wiki as well
314 // DEFAULT_WIKI_PGSRC defines where the English pages reside
315 // FIXME: is this really needed? Can't we just copy
316 // these pages into the localized pgsrc?
317 define('DEFAULT_WIKI_PGSRC', "pgsrc");
318 // These are the pages which will get loaded from DEFAULT_WIKI_PGSRC.
319 $GenericPages = array("ReleaseNotes", "SteveWainstead", "TestPage");
321 /////////////////////////////////////////////////////////////////////
326 /////////////////////////////////////////////////////////////////////
328 // allowed protocols for links - be careful not to allow "javascript:"
329 // URL of these types will be automatically linked.
330 // within a named link [name|uri] one more protocol is defined: phpwiki
331 $AllowedProtocols = "http|https|mailto|ftp|news|gopher";
333 // URLs ending with the following extension should be inlined as images
334 $InlineImages = "png|jpg|gif";
336 // Uncomment this to automatically split WikiWords by inserting spaces.
337 // The default is to leave WordsSmashedTogetherLikeSo in the body text.
338 //define("autosplit_wikiwords", 1);
340 // Perl regexp for WikiNames ("bumpy words")
341 // (?<!..) & (?!...) used instead of '\b' because \b matches '_' as well
342 $WikiNameRegexp = "(?<![[:alnum:]])([[:upper:]][[:lower:]]+){2,}(?![[:alnum:]])";
344 // InterWiki linking -- wiki-style links to other wikis on the web
346 // Intermap file for InterWikiLinks -- define other wikis there
347 // Leave this undefined to disable InterWiki linking.
348 define('INTERWIKI_MAP_FILE', "lib/interwiki.map");
350 /////////////////////////////////////////////////////////////////////
353 // URL options -- you can probably skip this section.
355 /////////////////////////////////////////////////////////////////////
356 /******************************************************************
358 * The following section contains settings which you can use to tailor
359 * the URLs which PhpWiki generates.
361 * Any of these parameters which are left undefined will be
362 * deduced automatically. You need only set them explicitly
363 * if the auto-detected values prove to be incorrect.
365 * In most cases the auto-detected values should work fine,
366 * so hopefully you don't need to mess with this section.
368 ******************************************************************/
371 * Canonical name and httpd port of the server on which this
374 //define('SERVER_NAME', 'some.host.com');
375 //define('SERVER_PORT', 80);
378 * Relative URL (from the server root) of the PhpWiki
381 //define('SCRIPT_NAME', '/some/where/index.php');
384 * Relative URL (from the server root) of the directory
385 * in which relative URL's for images and other support files
388 //define('DATA_PATH', '/some/where');
391 * Define to 'true' to use PATH_INFO to pass the pagename's.
392 * e.g. http://www.some.where/index.php/HomePage instead
393 * of http://www.some.where/index.php?pagename=HomePage
394 * FIXME: more docs (maybe in README).
396 //define('USE_PATH_INFO', false);
399 * VIRTUAL_PATH is the canonical URL path under which your
400 * your wiki appears. Normally this is the same as
401 * dirname(SCRIPT_NAME), however using, e.g. apaches mod_actions
402 * (or mod_rewrite), you can make it something different.
404 * If you do this, you should set VIRTUAL_PATH here.
406 * E.g. your phpwiki might be installed at at /scripts/phpwiki/index.php,
407 * but * you've made it accessible through eg. /wiki/HomePage.
409 * One way to do this is to create a directory named 'wiki' in your
410 * server root. The directory contains only one file: an .htaccess
411 * file which reads something like:
413 * Action x-phpwiki-page /scripts/phpwiki/index.php
414 * SetHandler x-phpwiki-page
415 * DirectoryIndex /scripts/phpwiki/index.php
417 * In that case you should set VIRTUAL_PATH to '/wiki'.
419 * (VIRTUAL_PATH is only used if USE_PATH_INFO is true.)
421 //define('VIRTUAL_PATH', '/SomeWiki');
424 ////////////////////////////////////////////////////////////////
425 // Okay... fire up the code:
426 ////////////////////////////////////////////////////////////////
428 include "lib/main.php";
430 // (c-file-style: "gnu")
435 // c-hanging-comment-ender-p: nil
436 // indent-tabs-mode: nil