]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - index.php
Added a flowerbox comment at the top of the file, explaining the whole
[SourceForge/phpwiki.git] / index.php
1 <?php
2
3 /*
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.
7
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.
12 */
13
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.
17
18
19 //ini_set('include_path', '.:/where/you/installed/phpwiki');
20
21 /////////////////////////////////////////////////////////////////////
22 // Part Null: Don't touch this!
23
24 define ('PHPWIKI_VERSION', '1.3.0pre');
25 require "lib/prepend.php";
26 rcs_id('$Id: index.php,v 1.14 2001-03-11 17:51:54 wainstead Exp $');
27
28 /////////////////////////////////////////////////////////////////////
29 //
30 // Part One:
31 // Authentication and security settings:
32 // 
33 /////////////////////////////////////////////////////////////////////
34
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);
38
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', "");
44
45 // If true, only the admin user can make zip dumps, else
46 // zip dumps require no authentication.
47 define('ZIPDUMP_AUTH', false);
48
49 // The maximum file upload size.
50 define('MAX_UPLOAD_SIZE', 16 * 1024 * 1024);
51
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);
55
56 // Actions listed in this array will not be allowed.
57 //$DisabledActions = array('dumpserial', 'loadfile');
58
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');
62
63 /////////////////////////////////////////////////////////////////////
64 //
65 // Part Two:
66 // Database Selection
67 //
68 /////////////////////////////////////////////////////////////////////
69
70 //
71 // This array holds the parameters which select the database to use.
72 //
73 // Not all of these parameters are used by any particular DB backend.
74 //
75 $DBParams = array(
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'.)
79    //'dbtype' => 'dba',
80    //'dbtype' => 'dbm',
81    //'dbtype' => 'mysql',
82    //'dbtype' => 'pgsql',
83    //'dbtype' => 'msql',
84    //'dbtype' => 'file',
85    
86    // Used by all DB types:
87    'database' => 'wiki',
88    'prefix' => '',      // prefix for filenames or table names
89    
90    // Used by 'dbm', 'dba', 'file'
91    'directory' => "/tmp",
92
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}*"
96    
97    // Used by 'dbm', 'dba'
98    'timeout' => 20,
99    
100    // Used by *sql as neccesary to log in to server:
101    'server'   => 'localhost',
102    'port'     => '',
103    'socket'   => '',
104    'user'     => 'guest',
105    'password' => ''
106 );
107
108
109 /////////////////////////////////////////////////////////////////////
110 // 
111 // Part Three:
112 // Page appearance and layout
113 //
114 /////////////////////////////////////////////////////////////////////
115
116 // Select your language - default language "C": English
117 // other languages available: Dutch "nl", Spanish "es", German "de",
118 // and Swedish "sv"
119 $LANG = "C";
120
121 // If you specify a relative URL for the CSS and images,
122 // the are interpreted relative to DATA_PATH (see below).
123 // (The default value of DATA_PATH is the directory in which
124 // index.php (this file) resides.)
125
126 // CSS location
127 define("CSS_URL", "phpwiki.css");
128
129 // logo image (path relative to index.php)
130 $logo = "images/wikibase.png";
131
132 // Signature image which is shown after saving an edited page
133 // If this is left blank (or unset), the signature will be omitted.
134 //$SignatureImg = "images/signature.png";
135
136 // date & time formats used to display modification times, etc.
137 // formats are given as format strings to PHP date() function
138 // FIXME: these should have different defaults depending on locale.
139 $datetimeformat = "F j, Y";     // may contain time of day
140 $dateformat = "F j, Y"; // must not contain time
141
142 // this defines how many page names to list when displaying
143 // the MostPopular pages; the default is to show the 20 most popular pages
144 define("MOST_POPULAR_LIST_LENGTH", 20);
145
146 // this defines how many page names to list when displaying related pages
147 define("NUM_RELATED_PAGES", 5);
148
149 // Template files (filenames are relative to script position)
150 // (These filenames will be passed through gettext() before use.)
151 $templates = array("BROWSE" =>    "templates/browse.html",
152                    "EDITPAGE" =>  "templates/editpage.html",
153                    "MESSAGE" =>   "templates/message.html");
154
155 /* WIKI_PGSRC -- specifies the source for the initial page contents
156  * of the Wiki.  The setting of WIKI_PGSRC only has effect when
157  * the wiki is accessed for the first time (or after clearing the
158  * database.) WIKI_PGSRC can either name a directory or a zip file.
159  * In either case WIKI_PGSRC is scanned for files --- one file per page.
160  */
161 define('WIKI_PGSRC', "pgsrc"); // Default (old) behavior.
162 //define('WIKI_PGSRC', 'wiki.zip'); // New style.
163
164 // DEFAULT_WIKI_PGSRC is only used when the language is *not*
165 // the default (English) and when reading from a directory:
166 // in that case some English pages are inserted into the wiki as well
167 // DEFAULT_WIKI_PGSRC defines where the English pages reside 
168 // FIXME: is this really needed?  Can't we just copy
169 //  these pages into the localized pgsrc?
170 define('DEFAULT_WIKI_PGSRC', "pgsrc");
171 // These are the pages which will get loaded from DEFAULT_WIKI_PGSRC.   
172 $GenericPages = array("ReleaseNotes", "SteveWainstead", "TestPage");
173
174 /////////////////////////////////////////////////////////////////////
175 //
176 // Part four:
177 // Mark-up options.
178 // 
179 /////////////////////////////////////////////////////////////////////
180
181 // allowed protocols for links - be careful not to allow "javascript:"
182 // URL of these types will be automatically linked.
183 // within a named link [name|uri] one more protocol is defined: phpwiki
184 $AllowedProtocols = "http|https|mailto|ftp|news|gopher";
185
186 // URLs ending with the following extension should be inlined as images
187 $InlineImages = "png|jpg|gif";
188
189 // Perl regexp for WikiNames ("bumpy words")
190 // (?<!..) & (?!...) used instead of '\b' because \b matches '_' as well
191 $WikiNameRegexp = "(?<![[:alnum:]])([[:upper:]][[:lower:]]+){2,}(?![[:alnum:]])";
192
193 // InterWiki linking -- wiki-style links to other wikis on the web
194 //
195 // Intermap file for InterWikiLinks -- define other wikis there
196 // Leave this undefined to disable InterWiki linking.
197 define('INTERWIKI_MAP_FILE', "lib/interwiki.map");
198
199 /////////////////////////////////////////////////////////////////////
200 //
201 // Part five:
202 // URL options -- you can probably skip this section.
203 //
204 /////////////////////////////////////////////////////////////////////
205 /******************************************************************
206  *
207  * The following section contains settings which you can use to tailor
208  * the URLs which PhpWiki generates. 
209  *
210  * Any of these parameters which are left undefined will be
211  * deduced automatically.  You need only set them explicitly
212  * if the auto-detected values prove to be incorrect.
213  *
214  * In most cases the auto-detected values should work fine,
215  * so hopefully you don't need to mess with this section.
216  *
217  ******************************************************************/
218
219 /*
220  * Canonical name and httpd port of the server on which this
221  * PhpWiki resides.
222  */
223 //define('SERVER_NAME', 'some.host.com');
224 //define('SERVER_PORT', 80);
225
226 /*
227  * Absolute URL (from the server root) of the PhpWiki
228  * script.
229  */
230 //define('SCRIPT_NAME', '/some/where/index.php');
231
232 /*
233  * Absolute URL (from the server root) of the directory
234  * in which relative URL's for images and other support files
235  * are interpreted.
236  */
237 //define('DATA_PATH', '/some/where');
238
239 /*
240  * Define to 'true' to use PATH_INFO to pass the pagename's.
241  * e.g. http://www.some.where/index.php/FrontPage instead
242  * of http://www.some.where/index.php?pagename=FrontPage
243  * FIXME: more docs (maybe in README).
244  */
245 //define('USE_PATH_INFO', false);
246
247 /*
248  * VIRTUAL_PATH is the canonical URL path under which your
249  * your wiki appears.  Normally this is the same as
250  * dirname(SCRIPT_NAME), however using, e.g. apaches mod_actions
251  * (or mod_rewrite), you can make it something different.
252  *
253  * If you do this, you should set VIRTUAL_PATH here.
254  *
255  * E.g. your phpwiki might be installed at at /scripts/phpwiki/index.php,
256  * but  * you've made it accessible through eg. /wiki/FrontPage.
257  *
258  * One way to do this is to create a directory named 'wiki' in your
259  * server root.  The directory contains only one file: an .htaccess
260  * file which reads something like:
261  *
262  *    Action x-phpwiki-page /scripts/phpwiki/index.php
263  *    SetHandler x-phpwiki-page
264  *    DirectoryIndex /scripts/phpwiki/index.php
265  *
266  * In that case you should set VIRTUAL_PATH to '/wiki'.
267  *
268  * (VIRTUAL_PATH is only used if USE_PATH_INFO is true.)
269  */
270 //define('VIRTUAL_PATH', '/SomeWiki');
271
272
273 ////////////////////////////////////////////////////////////////
274 // Okay... fire up the code:
275 ////////////////////////////////////////////////////////////////
276
277 include "lib/main.php";
278
279 // For emacs users
280 // Local Variables:
281 // mode: php
282 // c-file-style: "ellemtel"
283 // End:   
284 ?>