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.
19 //ini_set('include_path', '.:/where/you/installed/phpwiki');
21 /////////////////////////////////////////////////////////////////////
22 // Part Null: Don't touch this!
24 define ('PHPWIKI_VERSION', '1.3.0pre');
25 require "lib/prepend.php";
26 rcs_id('$Id: index.php,v 1.16 2001-04-07 00:34:30 dairiki Exp $');
28 /////////////////////////////////////////////////////////////////////
31 // Authentication and security settings:
33 /////////////////////////////////////////////////////////////////////
35 // If set, we will perform reverse dns lookups to try to convert the users
36 // IP number to a host name, even if the http server didn't do it for us.
37 define('ENABLE_REVERSE_DNS', true);
39 // Username and password of administrator.
40 // Set these to your preferences. For heaven's sake
41 // pick a good password!
42 define('ADMIN_USER', "");
43 define('ADMIN_PASSWD', "");
45 // If true, only the admin user can make zip dumps, else
46 // zip dumps require no authentication.
47 define('ZIPDUMP_AUTH', false);
49 // The maximum file upload size.
50 define('MAX_UPLOAD_SIZE', 16 * 1024 * 1024);
52 // If the last edit is older than MINOR_EDIT_TIMEOUT seconds, the default
53 // state for the "minor edit" checkbox on the edit page form will be off.
54 define("MINOR_EDIT_TIMEOUT", 7 * 24 * 3600);
56 // Actions listed in this array will not be allowed.
57 //$DisabledActions = array('dumpserial', 'loadfile');
59 // PhpWiki can generate an access_log (in "NCSA combined log" format)
60 // for you. If you want one, define this to the name of the log file.
61 define('ACCESS_LOG', '/tmp/wiki_access_log');
63 /////////////////////////////////////////////////////////////////////
68 /////////////////////////////////////////////////////////////////////
71 // This array holds the parameters which select the database to use.
73 // Not all of these parameters are used by any particular DB backend.
76 // Select the database type:
77 // Uncomment one of these, or leave all commented for the default
78 // data base type ('dba' if supported, else 'dbm'.)
81 //'dbtype' => 'mysql',
82 //'dbtype' => 'pgsql',
86 // Used by all DB types:
88 'prefix' => '', // prefix for filenames or table names
90 // Used by 'dbm', 'dba', 'file'
91 'directory' => "/tmp",
93 // 'dbm' and 'dba create files named "$directory/${database}{$prefix}*".
94 // 'file' creates files named "$directory/${database}/{$prefix}*/*".
95 // The sql types use tables named "{$prefix}*"
97 // Used by 'dbm', 'dba'
100 // Used by *sql as neccesary to log in to server:
101 'server' => 'localhost',
109 /////////////////////////////////////////////////////////////////////
112 // Page appearance and layout
114 /////////////////////////////////////////////////////////////////////
116 // Select your language/locale - default language "C": English
117 // other languages available: Dutch "nl", Spanish "es", German "de",
120 // Note that on some systems, apprently using these short forms for
121 // the locale won't work. On my home system 'LANG=de' won't result
122 // in german pages. Somehow the system must recognize the locale
123 // as a valid locale before gettext() will work. ('de_DE' works for
127 // Setting the LANG environment variable (accomplished above) may or
128 // may not be sufficient to cause PhpWiki to produce dates in your
129 // native language. (It depends on the configuration of the operating
130 // system on your http server.) The problem is that, e.g. 'de' is
131 // often not a valid locale.
133 // A standard locale name is typically of the form
134 // language[_territory][.codeset][@modifier], where language is
135 // an ISO 639 language code, territory is an ISO 3166 country code,
136 // and codeset is a character set or encoding identifier like
137 // ISO-8859-1 or UTF-8.
139 // You can tailor the locale used for time and date formatting by setting
140 // the LC_TIME environment variable. You'll have to experiment to find
141 // the correct setting:
142 //putenv('LC_TIME=de_DE');
144 // If you specify a relative URL for the CSS and images,
145 // the are interpreted relative to DATA_PATH (see below).
146 // (The default value of DATA_PATH is the directory in which
147 // index.php (this file) resides.)
150 define("CSS_URL", "phpwiki.css");
152 // logo image (path relative to index.php)
153 $logo = "images/wikibase.png";
155 // Signature image which is shown after saving an edited page
156 // If this is left blank (or unset), the signature will be omitted.
157 //$SignatureImg = "images/signature.png";
159 // Date & time formats used to display modification times, etc.
160 // Formats are given as format strings to PHP strftime() function
161 // See http://www.php.net/manual/en/function.strftime.php for details.
162 $datetimeformat = "%B %e, %Y"; // may contain time of day
163 $dateformat = "%B %e, %Y"; // must not contain time
165 // this defines how many page names to list when displaying
166 // the MostPopular pages; the default is to show the 20 most popular pages
167 define("MOST_POPULAR_LIST_LENGTH", 20);
169 // this defines how many page names to list when displaying related pages
170 define("NUM_RELATED_PAGES", 5);
172 // Template files (filenames are relative to script position)
173 // However, if a LANG is set, they we be searched for in a locale
174 // specific location first.
175 $templates = array("BROWSE" => "templates/browse.html",
176 "EDITPAGE" => "templates/editpage.html",
177 "MESSAGE" => "templates/message.html");
179 /* WIKI_PGSRC -- specifies the source for the initial page contents
180 * of the Wiki. The setting of WIKI_PGSRC only has effect when
181 * the wiki is accessed for the first time (or after clearing the
182 * database.) WIKI_PGSRC can either name a directory or a zip file.
183 * In either case WIKI_PGSRC is scanned for files --- one file per page.
185 define('WIKI_PGSRC', "pgsrc"); // Default (old) behavior.
186 //define('WIKI_PGSRC', 'wiki.zip'); // New style.
188 // DEFAULT_WIKI_PGSRC is only used when the language is *not*
189 // the default (English) and when reading from a directory:
190 // in that case some English pages are inserted into the wiki as well
191 // DEFAULT_WIKI_PGSRC defines where the English pages reside
192 // FIXME: is this really needed? Can't we just copy
193 // these pages into the localized pgsrc?
194 define('DEFAULT_WIKI_PGSRC', "pgsrc");
195 // These are the pages which will get loaded from DEFAULT_WIKI_PGSRC.
196 $GenericPages = array("ReleaseNotes", "SteveWainstead", "TestPage");
198 /////////////////////////////////////////////////////////////////////
203 /////////////////////////////////////////////////////////////////////
205 // allowed protocols for links - be careful not to allow "javascript:"
206 // URL of these types will be automatically linked.
207 // within a named link [name|uri] one more protocol is defined: phpwiki
208 $AllowedProtocols = "http|https|mailto|ftp|news|gopher";
210 // URLs ending with the following extension should be inlined as images
211 $InlineImages = "png|jpg|gif";
213 // Perl regexp for WikiNames ("bumpy words")
214 // (?<!..) & (?!...) used instead of '\b' because \b matches '_' as well
215 $WikiNameRegexp = "(?<![[:alnum:]])([[:upper:]][[:lower:]]+){2,}(?![[:alnum:]])";
217 // InterWiki linking -- wiki-style links to other wikis on the web
219 // Intermap file for InterWikiLinks -- define other wikis there
220 // Leave this undefined to disable InterWiki linking.
221 define('INTERWIKI_MAP_FILE', "lib/interwiki.map");
223 /////////////////////////////////////////////////////////////////////
226 // URL options -- you can probably skip this section.
228 /////////////////////////////////////////////////////////////////////
229 /******************************************************************
231 * The following section contains settings which you can use to tailor
232 * the URLs which PhpWiki generates.
234 * Any of these parameters which are left undefined will be
235 * deduced automatically. You need only set them explicitly
236 * if the auto-detected values prove to be incorrect.
238 * In most cases the auto-detected values should work fine,
239 * so hopefully you don't need to mess with this section.
241 ******************************************************************/
244 * Canonical name and httpd port of the server on which this
247 //define('SERVER_NAME', 'some.host.com');
248 //define('SERVER_PORT', 80);
251 * Absolute URL (from the server root) of the PhpWiki
254 //define('SCRIPT_NAME', '/some/where/index.php');
257 * Absolute URL (from the server root) of the directory
258 * in which relative URL's for images and other support files
261 //define('DATA_PATH', '/some/where');
264 * Define to 'true' to use PATH_INFO to pass the pagename's.
265 * e.g. http://www.some.where/index.php/HomePage instead
266 * of http://www.some.where/index.php?pagename=HomePage
267 * FIXME: more docs (maybe in README).
269 //define('USE_PATH_INFO', false);
272 * VIRTUAL_PATH is the canonical URL path under which your
273 * your wiki appears. Normally this is the same as
274 * dirname(SCRIPT_NAME), however using, e.g. apaches mod_actions
275 * (or mod_rewrite), you can make it something different.
277 * If you do this, you should set VIRTUAL_PATH here.
279 * E.g. your phpwiki might be installed at at /scripts/phpwiki/index.php,
280 * but * you've made it accessible through eg. /wiki/HomePage.
282 * One way to do this is to create a directory named 'wiki' in your
283 * server root. The directory contains only one file: an .htaccess
284 * file which reads something like:
286 * Action x-phpwiki-page /scripts/phpwiki/index.php
287 * SetHandler x-phpwiki-page
288 * DirectoryIndex /scripts/phpwiki/index.php
290 * In that case you should set VIRTUAL_PATH to '/wiki'.
292 * (VIRTUAL_PATH is only used if USE_PATH_INFO is true.)
294 //define('VIRTUAL_PATH', '/SomeWiki');
297 ////////////////////////////////////////////////////////////////
298 // Okay... fire up the code:
299 ////////////////////////////////////////////////////////////////
301 include "lib/main.php";
306 // c-file-style: "ellemtel"