4 Copyright 2000??, 2001, 2002 $ThePhpWikiProgrammingTeam = array(
8 This file is part of PhpWiki.
10 PhpWiki is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2 of the License, or
13 (at your option) any later version.
15 PhpWiki is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with PhpWiki; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 /////////////////////////////////////////////////////////////////////
28 This is the starting file for PhpWiki. All this file does
29 is set configuration options, and at the end of the file
30 it includes() the file lib/main.php, where the real action begins.
32 This file is divided into six parts: Parts Zero, One, Two, Three,
33 Four and Five. Each one has different configuration settings you
34 can change; in all cases the default should work on your system,
35 however, we recommend you tailor things to your particular setting.
38 /////////////////////////////////////////////////////////////////////
39 // Part Zero: If PHP needs help in finding where you installed the
40 // rest of the PhpWiki code, you can set the include_path here.
42 // NOTE: phpwiki uses the PEAR library of php code for SQL database
43 // access. Your PHP is probably already configured to set include_path
44 // so that PHP can find the pear code. If not (or if you change
45 // include_path here) make sure you include the path to the PEAR
46 // code in include_path. (To find the PEAR code on your system, search
47 // for a file named 'PEAR.php'. Some common locations are:
51 // /usr/local/share/php
53 // /System/Library/PHP
55 // The above examples are already included by PhpWiki.
56 // You shouldn't have to change this unless you see a WikiFatalError:
57 // lib/FileFinder.php:82: Fatal[256]: DB.php: file not found
59 //ini_set('include_path', '.:/where/you/installed/phpwiki');
61 /////////////////////////////////////////////////////////////////////
62 // Part Null: Don't touch this!
64 define ('PHPWIKI_VERSION', '1.3.2-jeffs-hacks');
65 require "lib/prepend.php";
66 rcs_id('$Id: index.php,v 1.55 2002-01-09 04:01:08 carstenklapp Exp $');
68 /////////////////////////////////////////////////////////////////////
71 // Authentication and security settings:
73 /////////////////////////////////////////////////////////////////////
75 // The name of your wiki.
76 // This is used to generate a keywords meta tag in the HTML templates,
77 // and during RSS generation for the <title> of the RSS channel.
78 //define('WIKI_NAME', 'PhpWiki');
80 // If set, we will perform reverse dns lookups to try to convert the users
81 // IP number to a host name, even if the http server didn't do it for us.
82 define('ENABLE_REVERSE_DNS', true);
84 // Username and password of administrator.
85 // Set these to your preferences. For heaven's sake
86 // pick a good password!
87 define('ADMIN_USER', "");
88 define('ADMIN_PASSWD', "");
90 // If true, only the admin user can make zip dumps, else
91 // zip dumps require no authentication.
92 define('ZIPDUMP_AUTH', false);
94 // This setting determines the type of page dumps. Must be one of
95 // "quoted-printable" or "binary".
96 $pagedump_format = "quoted-printable";
98 // The maximum file upload size.
99 define('MAX_UPLOAD_SIZE', 16 * 1024 * 1024);
101 // If the last edit is older than MINOR_EDIT_TIMEOUT seconds, the default
102 // state for the "minor edit" checkbox on the edit page form will be off.
103 define("MINOR_EDIT_TIMEOUT", 7 * 24 * 3600);
105 // Actions listed in this array will not be allowed.
106 //$DisabledActions = array('dumpserial', 'loadfile');
108 // PhpWiki can generate an access_log (in "NCSA combined log" format)
109 // for you. If you want one, define this to the name of the log file.
110 //define('ACCESS_LOG', '/tmp/wiki_access_log');
113 // If ALLOW_BOGO_LOGIN is true, users are allowed to login
114 // (with any/no password) using any userid which: 1) is not
115 // the ADMIN_USER, 2) is a valid WikiWord (matches $WikiNameRegexp.)
116 define('ALLOW_BOGO_LOGIN', true);
118 // The login code now uses PHP's session support. Usually, the default
119 // configuration of PHP is to store the session state information in
120 // /tmp. That probably will work fine, but fails e.g. on clustered
121 // servers where each server has their own distinct /tmp (this
122 // is the case on SourceForge's project web server.) You can specify
123 // an alternate directory in which to store state information like so
124 // (whatever user your httpd runs as must have read/write permission
125 // in this directory):
127 //ini_set('session.save_path', 'some_other_directory');
130 /////////////////////////////////////////////////////////////////////
133 // Database Selection
135 /////////////////////////////////////////////////////////////////////
138 // This array holds the parameters which select the database to use.
140 // Not all of these parameters are used by any particular DB backend.
143 // Select the database type:
147 // For SQL based backends, specify the database as a DSN
148 // The most general form of a DSN looks like:
150 // phptype(dbsyntax)://username:password@protocol+hostspec/database
152 // For a MySQL database, the following should work:
154 // mysql://user:password@host/databasename
156 // FIXME: My version Pear::DB seems to be broken enough that there is
157 // no way to connect to a mysql server over a socket right now.
158 //'dsn' => 'mysql://guest@:/var/lib/mysql/mysql.sock/test',
159 //'dsn' => 'mysql://guest@localhost/test',
160 //'dsn' => 'pgsql://localhost/test',
162 // Used by all DB types:
164 // prefix for filenames or table names
166 * currently you MUST EDIT THE SQL file too (in the schemas/ directory
167 * because we aren't doing on the fly sql generation during the
170 //'prefix' => 'phpwiki_',
173 'directory' => "/tmp",
174 'dba_handler' => 'gdbm', // Either of 'gdbm' or 'db2' work great for me.
175 //'dba_handler' => 'db2',
176 //'dba_handler' => 'db3', // doesn't work at all for me....
181 /////////////////////////////////////////////////////////////////////
183 // The next section controls how many old revisions of each page
184 // are kept in the database.
186 // There are two basic classes of revisions: major and minor.
187 // Which class a revision belongs in is determined by whether the
188 // author checked the "this is a minor revision" checkbox when they
191 // There is, additionally, a third class of revisions: author revisions.
192 // The most recent non-mergable revision from each distinct author is
193 // and author revision.
195 // The expiry parameters for each of those three classes of revisions
196 // can be adjusted seperately. For each class there are five
197 // parameters (usually, only two or three of the five are actually set)
198 // which control how long those revisions are kept in the database.
200 // max_keep: If set, this specifies an absolute maximum for the number
201 // of archived revisions of that class. This is meant to be
202 // used as a safety cap when a non-zero min_age is specified.
203 // It should be set relatively high, and it's purpose is to
204 // prevent malicious or accidental database overflow due
205 // to someone causing an unreasonable number of edits in a short
208 // min_age: Revisions younger than this (based upon the supplanted date)
209 // will be kept unless max_keep is exceeded. The age should
210 // be specified in days. It should be a non-negative,
213 // min_keep: At least this many revisions will be kept.
215 // keep: No more than this many revisions will be kept.
217 // max_age: No revision older than this age will be kept.
219 // Supplanted date: Revisions are timestamped at the instant that they cease
220 // being the current revision. Revision age is computed using this timestamp,
221 // not the edit time of the page.
223 // Merging: When a minor revision is deleted, if the preceding revision is by
224 // the same author, the minor revision is merged with the preceding revision
225 // before it is deleted. Essentially: this replaces the content (and supplanted
226 // timestamp) of the previous revision with the content after the merged minor
227 // edit, the rest of the page metadata for the preceding version (summary, mtime, ...)
230 // Keep up to 8 major edits, but keep them no longer than a month.
231 $ExpireParams['major'] = array('max_age' => 32,
233 // Keep up to 4 minor edits, but keep them no longer than a week.
234 $ExpireParams['minor'] = array('max_age' => 7,
236 // Keep the latest contributions of the last 8 authors up to a year.
237 // Additionally, (in the case of a particularly active page) try to keep the
238 // latest contributions of all authors in the last week (even if there are
239 // more than eight of them,) but in no case keep more than twenty unique
241 $ExpireParams['author'] = array('max_age' => 365,
246 /////////////////////////////////////////////////////////////////////
249 // Page appearance and layout
251 /////////////////////////////////////////////////////////////////////
253 // Select a valid charset name to be inserted into the xml/html pages.
254 // For more info see: <http://www.iana.org/assignments/character-sets>.
255 // Note that PhpWiki has been extensively tested only with the latin1
256 // (iso-8859-1) character set.
257 // If you change the default from iso-8859-1 PhpWiki may not work
258 // properly and it will require code modifications. However, character
259 // sets similar to iso-8859-1 may work with little or no modification
260 // depending on your setup. The database must also support the same
261 // charset, and of course the same is true for the web browser.
262 // (Some work is in progress hopefully to allow more flexibility in
263 // this area in the future).
264 define("CHARSET", "iso-8859-1");
266 // Select your language/locale - default language is "C" for English.
267 // Other languages available:
268 // English "C" (English - HomePage)
269 // Dutch "nl" (Nederlands - ThuisPagina)
270 // Spanish "es" (EspaƱol - PƔginaPrincipal)
271 // German "de" (Deutsch - StartSeite)
272 // Swedish "sv" (Svenska - Framsida)
273 // Italian "it" (Italiano - PaginaPrincipale)
275 // If you set $LANG to the empty string, your systems default
276 // language (as determined by the applicable environment variables)
279 // Note that on some systems, apprently using these short forms for
280 // the locale won't work. On my home system 'LANG=de' won't result
281 // in german pages. Somehow the system must recognize the locale
282 // as a valid locale before gettext() will work, i.e., use 'de_DE',
287 // Setting the LANG environment variable (accomplished above) may or
288 // may not be sufficient to cause PhpWiki to produce dates in your
289 // native language. (It depends on the configuration of the operating
290 // system on your http server.) The problem is that, e.g. 'de' is
291 // often not a valid locale.
293 // A standard locale name is typically of the form
294 // language[_territory][.codeset][@modifier], where language is
295 // an ISO 639 language code, territory is an ISO 3166 country code,
296 // and codeset is a character set or encoding identifier like
297 // ISO-8859-1 or UTF-8.
299 // You can tailor the locale used for time and date formatting by setting
300 // the LC_TIME environment variable. You'll have to experiment to find
301 // the correct setting:
302 //putenv('LC_TIME=de_DE');
304 // If you specify a relative URL for the CSS and images,
305 // the are interpreted relative to DATA_PATH (see below).
306 // (The default value of DATA_PATH is the directory in which
307 // index.php (this file) resides.)
311 // Note that if you use the stock phpwiki style sheet, 'phpwiki.css',
312 // you should make sure that it's companion 'phpwiki-heavy.css'
313 // is installed in the same directory that the base style file is.
314 // FIXME: These default CSS key names could use localization, but
315 // gettext() is not available at this point yet
317 'PhpWiki' => "phpwiki.css",
318 'Printer' => "phpwiki-printer.css",
319 'Modern' => "phpwiki-modern.css"
322 $CSS_DEFAULT = "PhpWiki";
324 // logo image (path relative to index.php)
325 $logo = "images/wikibase.png";
327 // RSS logo icon (path relative to index.php)
328 // If this is left blank (or unset), the default "images/rss.png"
330 //$rssicon = "images/rss.png";
332 // Signature image which is shown after saving an edited page
333 // If this is left blank (or unset), the signature will be omitted.
334 //$SignatureImg = "images/signature.png";
336 // this turns on url indicator icons, inserted before embedded links
337 // '*' icon is shown when the link type has no icon listed here,
338 // but ONLY for the AllowedProtocols specified in in part four!
339 // 'interwiki' icon indicates a Wiki listed in lib/interwiki.map
340 // If you want icons just to differentiate between urls and Wikis then
341 // turn on only 'interwiki' and '*', comment out the other four.
343 $URL_LINK_ICONS = array(
344 'http' => 'images/http.png',
345 'https' => 'images/https.png',
346 'ftp' => 'images/ftp.png',
347 'mailto' => 'images/mailto.png',
348 'interwiki' => 'images/interwiki.png',
349 '*' => 'images/zapg.png'
353 // Date & time formats used to display modification times, etc.
354 // Formats are given as format strings to PHP strftime() function
355 // See http://www.php.net/manual/en/function.strftime.php for details.
356 $datetimeformat = "%B %e, %Y"; // may contain time of day
357 $dateformat = "%B %e, %Y"; // must not contain time
360 // this defines how many page names to list when displaying
361 // the MostPopular pages; the default is to show the 20 most popular pages
362 define("MOST_POPULAR_LIST_LENGTH", 20);
364 // this defines how many page names to list when displaying related pages
365 define("NUM_RELATED_PAGES", 5);
367 // This defines separators used in RecentChanges and RecentEdits lists.
368 // If undefined, defaults to '' (nothing) and '...' (three periods).
369 //define("RC_SEPARATOR_A", '. . . ');
370 //define("RC_SEPARATOR_B", '. . . . . ');
372 // Template files (filenames are relative to script position)
373 // However, if a LANG is set, they we be searched for in a locale
374 // specific location first.
375 $templates = array("BROWSE" => "templates/browse.html",
376 "EDITPAGE" => "templates/editpage.html",
377 "MESSAGE" => "templates/message.html");
379 // The themeinfo file can be used to override default settings above this line
380 // (i.e. templates, logo, signature etc.)
381 // comment out the $theme= lines to revert to the standard interface
382 // which defaults to /templates and /images
387 if (!empty($theme)) {
388 if (file_exists("themes/$theme/themeinfo.php")) {
389 include "themes/$theme/themeinfo.php";
391 //FIXME: gettext doesn't work in index.php or themeinfo.php
392 trigger_error(sprintf(("Unable to open file '%s' for reading"),
393 "themes/$theme/themeinfo.php"), E_USER_NOTICE);
397 /* WIKI_PGSRC -- specifies the source for the initial page contents
398 * of the Wiki. The setting of WIKI_PGSRC only has effect when
399 * the wiki is accessed for the first time (or after clearing the
400 * database.) WIKI_PGSRC can either name a directory or a zip file.
401 * In either case WIKI_PGSRC is scanned for files --- one file per page.
403 define('WIKI_PGSRC', "pgsrc"); // Default (old) behavior.
404 //define('WIKI_PGSRC', 'wiki.zip'); // New style.
405 //define('WIKI_PGSRC', '../../../Logs/Hamwiki/hamwiki-20010830.zip'); // New style.
407 // DEFAULT_WIKI_PGSRC is only used when the language is *not*
408 // the default (English) and when reading from a directory:
409 // in that case some English pages are inserted into the wiki as well
410 // DEFAULT_WIKI_PGSRC defines where the English pages reside
411 // FIXME: is this really needed? Can't we just copy
412 // these pages into the localized pgsrc?
413 define('DEFAULT_WIKI_PGSRC', "pgsrc");
414 // These are the pages which will get loaded from DEFAULT_WIKI_PGSRC.
415 $GenericPages = array("ReleaseNotes", "SteveWainstead", "TestPage");
417 /////////////////////////////////////////////////////////////////////
422 /////////////////////////////////////////////////////////////////////
424 // allowed protocols for links - be careful not to allow "javascript:"
425 // URL of these types will be automatically linked.
426 // within a named link [name|uri] one more protocol is defined: phpwiki
427 $AllowedProtocols = "http|https|mailto|ftp|news|nntp|ssh|gopher";
429 // URLs ending with the following extension should be inlined as images
430 $InlineImages = "png|jpg|gif|tiff|tif";
432 // Uncomment this to automatically split WikiWords by inserting spaces.
433 // The default is to leave WordsSmashedTogetherLikeSo in the body text.
434 //define("autosplit_wikiwords", 1);
436 // Perl regexp for WikiNames ("bumpy words")
437 // (?<!..) & (?!...) used instead of '\b' because \b matches '_' as well
438 $WikiNameRegexp = "(?<![[:alnum:]])([[:upper:]][[:lower:]]+){2,}(?![[:alnum:]])";
440 // InterWiki linking -- wiki-style links to other wikis on the web
442 // Intermap file for InterWikiLinks -- define other wikis there
443 // Leave this undefined to disable InterWiki linking.
444 define('INTERWIKI_MAP_FILE', "lib/interwiki.map");
446 /////////////////////////////////////////////////////////////////////
449 // URL options -- you can probably skip this section.
451 /////////////////////////////////////////////////////////////////////
452 /******************************************************************
454 * The following section contains settings which you can use to tailor
455 * the URLs which PhpWiki generates.
457 * Any of these parameters which are left undefined will be
458 * deduced automatically. You need only set them explicitly
459 * if the auto-detected values prove to be incorrect.
461 * In most cases the auto-detected values should work fine,
462 * so hopefully you don't need to mess with this section.
464 ******************************************************************/
467 * Canonical name and httpd port of the server on which this
470 //define('SERVER_NAME', 'some.host.com');
471 //define('SERVER_PORT', 80);
474 * Relative URL (from the server root) of the PhpWiki
477 // Is this still required? Wiki seems to work fine without it,
478 // both with the server configured using alias directives
479 // or using SetHandler + virtual & data paths.
480 //define('SCRIPT_NAME', '/some/where/index.php');
483 * Relative URL (from the server root) of the directory
484 * in which relative URL's for images and other support files
487 //define('DATA_PATH', '/some/where');
490 * Define to 'true' to use PATH_INFO to pass the pagename's.
491 * e.g. http://www.some.where/index.php/HomePage instead
492 * of http://www.some.where/index.php?pagename=HomePage
493 * FIXME: more docs (maybe in README).
495 //define('USE_PATH_INFO', false);
498 * VIRTUAL_PATH is the canonical URL path under which your
499 * your wiki appears. Normally this is the same as
500 * dirname(SCRIPT_NAME), however using, e.g. apaches mod_actions
501 * (or mod_rewrite), you can make it something different.
503 * If you do this, you should set VIRTUAL_PATH here.
505 * E.g. your phpwiki might be installed at at /scripts/phpwiki/index.php,
506 * but * you've made it accessible through eg. /wiki/HomePage.
508 * One way to do this is to create a directory named 'wiki' in your
509 * server root. The directory contains only one file: an .htaccess
510 * file which reads something like:
512 * Action x-phpwiki-page /scripts/phpwiki/index.php
513 * SetHandler x-phpwiki-page
514 * DirectoryIndex /scripts/phpwiki/index.php
516 * In that case you should set VIRTUAL_PATH to '/wiki'.
518 * (VIRTUAL_PATH is only used if USE_PATH_INFO is true.)
520 //define('VIRTUAL_PATH', '/SomeWiki');
523 ////////////////////////////////////////////////////////////////
524 // Okay... fire up the code:
525 ////////////////////////////////////////////////////////////////
527 include "lib/main.php";
529 // (c-file-style: "gnu")
534 // c-hanging-comment-ender-p: nil
535 // indent-tabs-mode: nil