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