4 Copyright 1999, 2000, 2001, 2002 $ThePhpWikiProgrammingTeam = array(
5 "Steve Wainstead", "Clifford A. Adams", "Lawrence Akka",
6 "Scott R. Anderson", "Jon Åslund", "Neil Brown", "Jeff Dairiki",
7 "Stéphane Gourichon", "Jan Hidders", "Arno Hollosi", "John Jorgensen",
8 "Antti Kaihola", "Jeremie Kass", "Carsten Klapp", "Marco Milanesi",
9 "Grant Morgan", "Jan Nieuwenhuizen", "Aredridel Niothke",
10 "Pablo Roca Rozas", "Sandino Araico Sánchez", "Joel Uckelman",
11 "Reini Urban", "Tim Voght", "Jochen Kalmbach");
13 This file is part of PhpWiki.
15 PhpWiki is free software; you can redistribute it and/or modify
16 it under the terms of the GNU General Public License as published by
17 the Free Software Foundation; either version 2 of the License, or
18 (at your option) any later version.
20 PhpWiki is distributed in the hope that it will be useful,
21 but WITHOUT ANY WARRANTY; without even the implied warranty of
22 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 GNU General Public License for more details.
25 You should have received a copy of the GNU General Public License
26 along with PhpWiki; if not, write to the Free Software
27 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
31 /////////////////////////////////////////////////////////////////////
33 This is the starting file for PhpWiki. All this file does is set
34 configuration options, and at the end of the file it includes() the
35 file lib/main.php, where the real action begins.
37 This file is divided into seven parts: Parts Zero, One, Two, Three,
38 Four, Five and Six. Each one has different configuration settings you can
39 change; in all cases the default should work on your system,
40 however, we recommend you tailor things to your particular setting.
43 /////////////////////////////////////////////////////////////////////
44 // Part Zero: If PHP needs help in finding where you installed the
45 // rest of the PhpWiki code, you can set the include_path here.
47 // Define PHP's include path so that it can find the PHP source code
50 // You shouldn't need to do this unless you've moved index.php out
51 // of the PhpWiki install directory.
53 // Note that on Windows-based servers, you should use ; rather than :
54 // as the path separator.
55 //ini_set('include_path', '.:/usr/local/httpd/phpwiki');
57 if (!defined('DEBUG')) define ('DEBUG', 0);
59 /////////////////////////////////////////////////////////////////////
60 // Part Null: Don't touch this!
62 define ('PHPWIKI_VERSION', '1.3.7pre');
63 require "lib/prepend.php";
64 rcs_id('$Id: index.php,v 1.112 2003-11-17 15:49:21 carstenklapp Exp $');
66 /////////////////////////////////////////////////////////////////////
69 // Authentication and security settings. See Part Three for more.
71 /////////////////////////////////////////////////////////////////////
73 // The name of your wiki.
74 // This is used to generate a keywords meta tag in the HTML templates,
75 // in bookmark titles for any bookmarks made to pages in your wiki,
76 // and during RSS generation for the <title> of the RSS channel.
77 if (!defined('WIKI_NAME')) define('WIKI_NAME', 'PhpWiki');
79 // If set, we will perform reverse dns lookups to try to convert the
80 // users IP number to a host name, even if the http server didn't do
82 if (!defined('ENABLE_REVERSE_DNS')) 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 or use our passwordencrypt.php tool.
87 if (!defined('ADMIN_USER')) define('ADMIN_USER', "");
88 if (!defined('ADMIN_PASSWD')) define('ADMIN_PASSWD', "");
89 // If you used the passencrypt.php utility to encode the password
90 // then uncomment this line. Recommended!
91 //if (!defined('ENCRYPTED_PASSWD')) define('ENCRYPTED_PASSWD', true);
93 // If true, only the admin user can make zip dumps, else zip dumps
94 // require no authentication.
95 if (!defined('ZIPDUMP_AUTH')) define('ZIPDUMP_AUTH', false);
97 // Define to false to disable the RawHtml plugin.
98 //if (!defined('ENABLE_RAW_HTML')) define('ENABLE_RAW_HTML', false);
100 // If you define this to true, (MIME-type) page-dumps (either zip dumps,
101 // or "dumps to directory" will be encoded using the quoted-printable
102 // encoding. If you're actually thinking of mailing the raw page dumps,
103 // then this might be useful, since (among other things,) it ensures
104 // that all lines in the message body are under 80 characters in length.
106 // Also, setting this will cause a few additional mail headers
107 // to be generated, so that the resulting dumps are valid
108 // RFC 2822 e-mail messages.
110 // Probably, you can just leave this set to false, in which case you get
111 // raw ('binary' content-encoding) page dumps.
112 if (!defined('STRICT_MAILABLE_PAGEDUMPS')) define('STRICT_MAILABLE_PAGEDUMPS', false);
114 // Here you can change the filename suffix used for XHTML page dumps.
115 // If you don't want any suffix just comment this out.
116 $HTML_DUMP_SUFFIX = '.html';
118 // The maximum file upload size.
119 if (!defined('MAX_UPLOAD_SIZE')) define('MAX_UPLOAD_SIZE', 16 * 1024 * 1024);
121 // If the last edit is older than MINOR_EDIT_TIMEOUT seconds, the
122 // default state for the "minor edit" checkbox on the edit page form
124 if (!defined('MINOR_EDIT_TIMEOUT')) define("MINOR_EDIT_TIMEOUT", 7 * 24 * 3600);
126 // Actions listed in this array will not be allowed.
127 //$DisabledActions = array('dumpserial', 'loadfile');
129 // PhpWiki can generate an access_log (in "NCSA combined log" format)
130 // for you. If you want one, define this to the name of the log file.
131 //define('ACCESS_LOG', '/tmp/wiki_access_log');
134 // By default PhpWiki will try to have PHP compress it's output
135 // before sending it to the browser (if you have a recent enough
136 // version of PHP and the browser supports it.)
137 // Define COMPRESS_OUTPUT to false to prevent output compression.
138 // Define COMPRESS_OUTPUT to true to force output compression,
139 // even if we think your version of PHP does this in a buggy
141 // Leave it undefined to leave the choice up to PhpWiki.
142 //define('COMPRESS_OUTPUT', false);
145 // HTTP CACHE_CONTROL
147 // This controls how PhpWiki sets the HTTP cache control
148 // headers (Expires: and Cache-Control:)
152 // NONE: This is roughly the old (pre 1.3.4) behavior. PhpWiki will
153 // instruct proxies and browsers never to cache PhpWiki output.
155 // STRICT: Cached pages will be invalidated whenever the database global
156 // timestamp changes. This should behave just like NONE (modulo
157 // bugs in PhpWiki and your proxies and browsers), except that
158 // things will be slightly more efficient.
160 // LOOSE: Cached pages will be invalidated whenever they are edited,
161 // or, if the pages include plugins, when the plugin output could
162 // concievably have changed.
164 // Behavior should be much like STRICT, except that sometimes
165 // wikilinks will show up as undefined (with the question mark)
166 // when in fact they refer to (recently) created pages.
167 // (Hitting your browsers reload or perhaps shift-reload button
168 // should fix the problem.)
170 // ALLOW_STALE: Proxies and browsers will be allowed to used stale pages.
171 // (The timeout for stale pages is controlled by CACHE_CONTROL_MAX_AGE.)
173 // This setting will result in quirky behavior. When you edit a
174 // page your changes may not show up until you shift-reload the
177 // This setting is generally not advisable, however it may be useful
178 // in certain cases (e.g. if your wiki gets lots of page views,
179 // and few edits by knowledgable people who won't freak over the quirks.)
181 // The default is currently LOOSE.
183 if (!defined('CACHE_CONTROL')) define('CACHE_CONTROL', 'LOOSE');
185 // Maximum page staleness, in seconds.
187 // This only has effect if CACHE_CONTROL is set to ALLOW_STALE.
188 if (!defined('CACHE_CONTROL_MAX_AGE')) define('CACHE_CONTROL_MAX_AGE', 600);
193 // PhpWiki normally caches a preparsed version (i.e. mostly
194 // converted to HTML) of the most recent version of each page.
195 // (Parsing the wiki-markup takes a fair amount of CPU.)
197 // Define WIKIDB_NOCACHE_MARKUP to true to disable the
198 // caching of marked-up page content.
200 // Note that you can also disable markup caching on a per-page
201 // temporary basis by addinging a query arg of '?nocache=1'
202 // to the URL to the page. (Use '?nocache=purge' to completely
203 // discard the cached version of the page.)
205 // You can also purge the cached markup globally by using the
206 // "Purge Markup Cache" button on the PhpWikiAdministration page.
207 //if (!defined('WIKIDB_NOCACHE_MARKUP')) define ('WIKIDB_NOCACHE_MARKUP', true);
210 /////////////////////////////////////////////////////////////////////
213 // Database Selection
215 /////////////////////////////////////////////////////////////////////
218 // This array holds the parameters which select the database to use.
220 // Not all of these parameters are used by any particular DB backend.
223 // Select the database type:
224 // Choose ADODB or SQL to use an SQL database with ADODB or PEAR.
225 // Choose dba to use one of the standard UNIX dbm libraries.
226 // Choose file to use a flat file database.
227 //'dbtype' => 'ADODB',
230 //'dbtype' => 'file',
232 // For SQL based backends, specify the database as a DSN
233 // The most general form of a DSN looks like:
235 // phptype(dbsyntax)://username:password@protocol+hostspec/database
237 // For a MySQL database, the following should work:
239 // mysql://user:password@host/databasename
241 // To connect over a unix socket, use something like
243 // mysql://user:password@unix(/path/to/socket)/databasename
245 //'dsn' => 'mysql://guest@unix(/var/lib/mysql/mysql.sock)/test',
246 //'dsn' => 'mysql://guest@localhost/test',
247 //'dsn' => 'pgsql://localhost/test',
250 'db_session_table' => 'session',
252 // Used by all DB types:
254 // prefix for filenames or table names
256 * currently you MUST EDIT THE SQL file too (in the schemas/
257 * directory because we aren't doing on the fly sql generation
258 * during the installation.
260 //'prefix' => 'phpwiki_',
262 // Used by either 'dba' or 'file' and must be writable by the web
263 // server If you leave this as '/tmp' you will probably lose all
264 // your files eventually
265 'directory' => "/tmp",
267 // choose the type of DB database file to use; most GNU systems have gdbm
268 'dba_handler' => 'gdbm', // Either of 'gdbm' or 'db2' work great for me.
269 //'dba_handler' => 'db2',
270 //'dba_handler' => 'db3', // Works fine on Windows, but not on every linux.
271 //'dba_handler' => 'dbm', // On sf.net redhat there's dbm and gdbm.
272 // dbm suffers from limits on size of data items?
278 // Only for 'dbtype' => 'SQL'. See schemas/mysql.sql or schemas/psql.sql
279 //define('USE_DB_SESSION',true);
281 /////////////////////////////////////////////////////////////////////
283 // The next section controls how many old revisions of each page are
284 // kept in the database.
286 // There are two basic classes of revisions: major and minor. Which
287 // class a revision belongs in is determined by whether the author
288 // checked the "this is a minor revision" checkbox when they saved the
291 // There is, additionally, a third class of revisions: author
292 // revisions. The most recent non-mergable revision from each distinct
293 // author is and author revision.
295 // The expiry parameters for each of those three classes of revisions
296 // can be adjusted seperately. For each class there are five
297 // parameters (usually, only two or three of the five are actually
298 // set) which control how long those revisions are kept in the
301 // max_keep: If set, this specifies an absolute maximum for the
302 // number of archived revisions of that class. This is
303 // meant to be used as a safety cap when a non-zero
304 // min_age is specified. It should be set relatively high,
305 // and it's purpose is to prevent malicious or accidental
306 // database overflow due to someone causing an
307 // unreasonable number of edits in a short period of time.
309 // min_age: Revisions younger than this (based upon the supplanted
310 // date) will be kept unless max_keep is exceeded. The age
311 // should be specified in days. It should be a
312 // non-negative, real number,
314 // min_keep: At least this many revisions will be kept.
316 // keep: No more than this many revisions will be kept.
318 // max_age: No revision older than this age will be kept.
320 // Supplanted date: Revisions are timestamped at the instant that they
321 // cease being the current revision. Revision age is computed using
322 // this timestamp, not the edit time of the page.
324 // Merging: When a minor revision is deleted, if the preceding
325 // revision is by the same author, the minor revision is merged with
326 // the preceding revision before it is deleted. Essentially: this
327 // replaces the content (and supplanted timestamp) of the previous
328 // revision with the content after the merged minor edit, the rest of
329 // the page metadata for the preceding version (summary, mtime, ...)
332 // Keep up to 8 major edits, but keep them no longer than a month.
333 $ExpireParams['major'] = array('max_age' => 32,
335 // Keep up to 4 minor edits, but keep them no longer than a week.
336 $ExpireParams['minor'] = array('max_age' => 7,
338 // Keep the latest contributions of the last 8 authors up to a year.
339 // Additionally, (in the case of a particularly active page) try to
340 // keep the latest contributions of all authors in the last week (even
341 // if there are more than eight of them,) but in no case keep more
342 // than twenty unique author revisions.
343 $ExpireParams['author'] = array('max_age' => 365,
348 /////////////////////////////////////////////////////////////////////
350 // Part Three: (optional)
351 // User Authentification
353 /////////////////////////////////////////////////////////////////////
355 // The wiki can be protected by HTTP Auth. Use the username and password
356 // from there, but this is not sufficient. Try the other methods also.
357 if (!defined('ALLOW_HTTP_AUTH_LOGIN')) define('ALLOW_HTTP_AUTH_LOGIN', false);
359 // If ALLOW_USER_LOGIN is true, any defined internal and external
360 // authentification method is tried.
361 // If not, we don't care about passwords, but listen to the next
363 if (!defined('ALLOW_USER_LOGIN')) define('ALLOW_USER_LOGIN', true);
365 // If ALLOW_BOGO_LOGIN is true, users are allowed to login (with
366 // any/no password) using any userid which:
367 // 1) is not the ADMIN_USER,
368 // 2) is a valid WikiWord (matches $WikiNameRegexp.)
369 // If true, users may be created by themselves. Otherwise we need seperate auth.
370 // This might be renamed to ALLOW_SELF_REGISTRATION.
371 if (!defined('ALLOW_BOGO_LOGIN')) define('ALLOW_BOGO_LOGIN', true);
373 // This will go away, with true page permissions.
374 // If set, then if an anonymous user attempts to edit a page he will
375 // be required to sign in. (If ALLOW_BOGO_LOGIN is true, of course,
376 // no password is required, but the user must still sign in under
377 // some sort of BogoUserId.)
378 if (!defined('REQUIRE_SIGNIN_BEFORE_EDIT')) define('REQUIRE_SIGNIN_BEFORE_EDIT', false);
380 // The login code now uses PHP's session support. Usually, the default
381 // configuration of PHP is to store the session state information in
382 // /tmp. That probably will work fine, but fails e.g. on clustered
383 // servers where each server has their own distinct /tmp (this is the
384 // case on SourceForge's project web server.) You can specify an
385 // alternate directory in which to store state information like so
386 // (whatever user your httpd runs as must have read/write permission
387 // in this directory):
389 //ini_set('session.save_path', 'some_other_directory');
391 // If your php was compiled with --enable-trans-sid it tries to
392 // add a PHPSESSID query argument to all URL strings when cookie
393 // support isn't detected in the client browser. For reasons
394 // which aren't entirely clear (PHP bug) this screws up the URLs
395 // generated by PhpWiki. Therefore, transparent session ids
396 // should be disabled. This next line does that.
398 // (At the present time, you will not be able to log-in to PhpWiki,
399 // unless your browser supports cookies.)
400 @ini_set('session.use_trans_sid', 0);
403 if (!defined('ALLOW_LDAP_LOGIN')) define('ALLOW_LDAP_LOGIN', true and function_exists('ldap_connect'));
404 if (!defined('LDAP_AUTH_HOST')) define('LDAP_AUTH_HOST', 'localhost');
405 // Give the right LDAP root search information in the next statement.
406 if (!defined('LDAP_AUTH_SEARCH')) define('LDAP_AUTH_SEARCH', "ou=mycompany.com,o=My Company");
408 // IMAP auth: check userid/passwords from a imap server, defaults to localhost
409 if (!defined('ALLOW_IMAP_LOGIN')) define('ALLOW_IMAP_LOGIN', true and function_exists('imap_open'));
410 if (!defined('IMAP_AUTH_HOST')) define('IMAP_AUTH_HOST', 'localhost');
412 // Sample of external AuthDB mysql tables to check against
416 userid char(48) binary NOT NULL UNIQUE,
417 preferences text NULL default '',
420 INSERT INTO user VALUES ('ReiniUrban', 'a:1:{s:6:"passwd";s:13:"7cyrcMAh0grMI";}');
424 userid char(48) binary NOT NULL UNIQUE,
425 passwd char(48) binary default '*',
430 // external mysql member table
432 CREATE TABLE member (
433 user char(48) NOT NULL,
434 group char(48) NOT NULL default 'users',
436 KEY groupname (groupname)
438 INSERT INTO member VALUES ('wikiadmin', 'root');
439 INSERT INTO member VALUES ('TestUser', 'users');
443 // Seperate DB User Authentification.
444 // Can be external, like radius, phpnuke, courier authmysql,
445 // apache auth_mysql or something else.
446 // The default is to store the data as metadata in WikiPages.
447 // The most likely dsn option is the same dsn as the wikipages.
448 $DBAuthParams = array(
449 //'auth_dsn' => 'mysql://localhost/phpwiki',
452 'auth_check' => 'SELECT passwd FROM user WHERE username="$userid"',
453 // Alternatively we accept files also. (not yet)
454 //'auth_user_file' => '/etc/shadow', // '/etc/httpd/.htpasswd'
456 'auth_crypt_method' => 'crypt', // 'crypt' (unix) or 'md5' (mysql) or just 'plain'
457 // 'auth_crypt_method' => 'md5', // for 'mysql://localhost/mysql' users
458 // 'auth_crypt_method' => 'plain',
460 // If 'auth_update' is not defined but 'auth_check' is defined, the user cannot
461 // change his password.
462 // $password is processed by the 'auth_crypt_method'.
463 'auth_update' => 'UPDATE user SET password="$password" WHERE username="$userid"',
465 // USER => PREFERENCES
466 // This can be optionally defined in an external DB.
467 // The default is the users homepage.
468 //'pref_select' => 'SELECT pref from user WHERE username="$userid"',
469 //'pref_update' => 'UPDATE user SET prefs="$pref_blob" WHERE username="$userid"',
472 // This can be optionally defined in an external DB. The default is a
473 // special locked wikipage for groupmembers .(which?)
474 // All members of the group:
475 'group_members' => 'SELECT username FROM grouptable WHERE groupname="$group"',
476 // All groups this user belongs to:
477 'user_groups' => 'SELECT groupname FROM grouptable WHERE username="$userid"',
478 // Alternatively we accept files also. (not yet)
479 //'auth_group_file' => '/etc/groups', // '/etc/httpd/.htgroup'
484 /////////////////////////////////////////////////////////////////////
487 // Page appearance and layout
489 /////////////////////////////////////////////////////////////////////
493 * Most of the page appearance is controlled by files in the theme
496 * There are a number of pre-defined themes shipped with PhpWiki.
497 * Or you may create your own (e.g. by copying and then modifying one of
502 if (!defined('THEME')) {
503 define('THEME', 'default');
504 //define('THEME', 'Hawaiian');
505 //define('THEME', 'MacOSX');
506 //define('THEME', 'Portland');
507 //define('THEME', 'Sidebar');
508 //define('THEME', 'SpaceWiki');
511 // Select a valid charset name to be inserted into the xml/html pages,
512 // and to reference links to the stylesheets (css). For more info see:
513 // <http://www.iana.org/assignments/character-sets>. Note that PhpWiki
514 // has been extensively tested only with the latin1 (iso-8859-1)
517 // If you change the default from iso-8859-1 PhpWiki may not work
518 // properly and it will require code modifications. However, character
519 // sets similar to iso-8859-1 may work with little or no modification
520 // depending on your setup. The database must also support the same
521 // charset, and of course the same is true for the web browser. (Some
522 // work is in progress hopefully to allow more flexibility in this
523 // area in the future).
524 if (!defined('CHARSET')) define("CHARSET", "iso-8859-1");
526 // Select your language/locale - default language is "en" for English.
527 // Other languages available:
528 // English "en" (English - HomePage)
529 // Dutch "nl" (Nederlands - ThuisPagina)
530 // Spanish "es" (Español - PáginaPrincipal)
531 // French "fr" (Français - Accueil)
532 // German "de" (Deutsch - StartSeite)
533 // Swedish "sv" (Svenska - Framsida)
534 // Italian "it" (Italiano - PaginaPrincipale)
536 // If you set DEFAULT_LANGUAGE to the empty string, your systems
537 // default language (as determined by the applicable environment
538 // variables) will be used.
540 if (!defined('DEFAULT_LANGUAGE')) define('DEFAULT_LANGUAGE', 'en');
542 /* WIKI_PGSRC -- specifies the source for the initial page contents of
543 * the Wiki. The setting of WIKI_PGSRC only has effect when the wiki is
544 * accessed for the first time (or after clearing the database.)
545 * WIKI_PGSRC can either name a directory or a zip file. In either case
546 * WIKI_PGSRC is scanned for files -- one file per page.
548 if (!defined('WIKI_PGSRC')) define('WIKI_PGSRC', "pgsrc"); // Default (old) behavior.
549 //define('WIKI_PGSRC', 'wiki.zip'); // New style.
550 //define('WIKI_PGSRC', '../../../Logs/Hamwiki/hamwiki-20010830.zip'); // New style.
553 * DEFAULT_WIKI_PGSRC is only used when the language is *not* the
554 * default (English) and when reading from a directory: in that case
555 * some English pages are inserted into the wiki as well.
556 * DEFAULT_WIKI_PGSRC defines where the English pages reside.
558 // FIXME: is this really needed? Can't we just copy these pages into
559 // the localized pgsrc?
560 define('DEFAULT_WIKI_PGSRC', "pgsrc");
561 // These are the pages which will get loaded from DEFAULT_WIKI_PGSRC.
562 $GenericPages = array("ReleaseNotes", "SteveWainstead", "TestPage");
564 /////////////////////////////////////////////////////////////////////
569 /////////////////////////////////////////////////////////////////////
571 // allowed protocols for links - be careful not to allow "javascript:"
572 // URL of these types will be automatically linked.
573 // within a named link [name|uri] one more protocol is defined: phpwiki
574 $AllowedProtocols = "http|https|mailto|ftp|news|nntp|ssh|gopher";
576 // URLs ending with the following extension should be inlined as images
577 $InlineImages = "png|jpg|gif";
579 // Perl regexp for WikiNames ("bumpy words")
580 // (?<!..) & (?!...) used instead of '\b' because \b matches '_' as well
581 $WikiNameRegexp = "(?<![[:alnum:]])(?:[[:upper:]][[:lower:]]+){2,}(?![[:alnum:]])";
583 // Defaults to '/', but '.' was also used.
584 if (!defined('SUBPAGE_SEPARATOR')) define('SUBPAGE_SEPARATOR', '/');
586 // InterWiki linking -- wiki-style links to other wikis on the web
588 // The map will be taken from a page name InterWikiMap.
589 // If that page is not found (or is not locked), or map
590 // data can not be found in it, then the file specified
591 // by INTERWIKI_MAP_FILE (if any) will be used.
592 define('INTERWIKI_MAP_FILE', "lib/interwiki.map");
594 // Display a warning if the internal lib/interwiki.map is used, and
595 // not the public InterWikiMap page. This map is not readable from outside.
596 //define('WARN_NONPUBLIC_INTERWIKIMAP', false);
598 // Regexp used for automatic keyword extraction.
600 // Any links on a page to pages whose names match this regexp will
601 // be used keywords in the keywords meta tag. (This is an aid to
602 // classification by search engines.) The value of the match is
603 // used as the keyword.
605 // The default behavior is to match Category* and Topic* links.
606 $KeywordLinkRegexp = '(?<=^Category|^Topic)[[:upper:]].*$';
608 /////////////////////////////////////////////////////////////////////
611 // URL options -- you can probably skip this section.
613 /////////////////////////////////////////////////////////////////////
614 /******************************************************************
616 * The following section contains settings which you can use to tailor
617 * the URLs which PhpWiki generates.
619 * Any of these parameters which are left undefined will be deduced
620 * automatically. You need only set them explicitly if the
621 * auto-detected values prove to be incorrect.
623 * In most cases the auto-detected values should work fine, so
624 * hopefully you don't need to mess with this section.
626 * In case of local overrides of short placeholders, which themselves
627 * include index.php, we check for most constants. See '/wiki'.
628 * We can override DATA_PATH and PHPWIKI_DIR to support multiple phpwiki
629 * versions (for development), but most likely other values like
630 * THEME, $LANG and $DbParams for a WikiFarm.
632 ******************************************************************/
635 * Canonical name and httpd port of the server on which this PhpWiki
638 //if (!defined('SERVER_NAME')) define('SERVER_NAME', 'some.host.com');
639 //define('SERVER_PORT', 80);
642 * Relative URL (from the server root) of the PhpWiki
645 //if (!defined('SCRIPT_NAME')) define('SCRIPT_NAME', '/some/where/index.php');
648 * URL of the PhpWiki install directory. (You only need to set this
649 * if you've moved index.php out of the install directory.) This can
650 * be either a relative URL (from the directory where the top-level
651 * PhpWiki script is) or an absolute one.
653 //if (!defined('DATA_PATH')) define('DATA_PATH', '/home/user/phpwiki');
656 * Path to the PhpWiki install directory. This is the local
657 * filesystem counterpart to DATA_PATH. (If you have to set
658 * DATA_PATH, your probably have to set this as well.) This can be
659 * either an absolute path, or a relative path interpreted from the
660 * directory where the top-level PhpWiki script (normally index.php)
663 //if (!defined('PHPWIKI_DIR')) define('PHPWIKI_DIR', 'C:/Apache/phpwiki');
664 //if (!defined('PHPWIKI_DIR')) define('PHPWIKI_DIR', '/home/user/public_html/phpwiki');
667 * PhpWiki will try to use short urls to pages, eg
668 * http://www.example.com/index.php/HomePage
669 * If you want to use urls like
670 * http://www.example.com/index.php?pagename=HomePage
671 * then define 'USE_PATH_INFO' as false by uncommenting the line below.
672 * NB: If you are using Apache >= 2.0.30, then you may need to to use
673 * the directive "AcceptPathInfo On" in your Apache configuration file
674 * (or in an appropriate <.htaccess> file) for the short urls to work:
675 * See http://httpd.apache.org/docs-2.0/mod/core.html#acceptpathinfo
677 * See also http://phpwiki.sourceforge.net/phpwiki/PrettyWiki for more ideas
678 * on prettifying your urls.
680 * Default: PhpWiki will try to divine whether use of PATH_INFO
681 * is supported in by your webserver/PHP configuration, and will
682 * use PATH_INFO if it thinks that is possible.
684 //if (!defined('USE_PATH_INFO')) define('USE_PATH_INFO', false);
687 * VIRTUAL_PATH is the canonical URL path under which your your wiki
688 * appears. Normally this is the same as dirname(SCRIPT_NAME), however
689 * using, e.g. apaches mod_actions (or mod_rewrite), you can make it
690 * something different.
692 * If you do this, you should set VIRTUAL_PATH here.
694 * E.g. your phpwiki might be installed at at /scripts/phpwiki/index.php,
695 * but * you've made it accessible through eg. /wiki/HomePage.
697 * One way to do this is to create a directory named 'wiki' in your
698 * server root. The directory contains only one file: an .htaccess
699 * file which reads something like:
701 * Action x-phpwiki-page /scripts/phpwiki/index.php
702 * SetHandler x-phpwiki-page
703 * DirectoryIndex /scripts/phpwiki/index.php
705 * In that case you should set VIRTUAL_PATH to '/wiki'.
707 * (VIRTUAL_PATH is only used if USE_PATH_INFO is true.)
709 //if (!defined('VIRTUAL_PATH')) define('VIRTUAL_PATH', '/SomeWiki');
711 /////////////////////////////////////////////////////////////////////
714 // Miscellaneous settings
716 /////////////////////////////////////////////////////////////////////
719 * Page name of RecentChanges page. Used for RSS Auto-discovery
722 if (!defined('RECENT_CHANGES')) define ('RECENT_CHANGES', 'RecentChanges');
725 * Disable HTTP redirects.
727 * (You probably don't need to touch this.)
729 * PhpWiki uses HTTP redirects for some of it's functionality.
730 * (e.g. after saving changes, PhpWiki redirects your browser to
731 * view the page you just saved.)
733 * Some web service providers (notably free European Lycos) don't seem to
734 * allow these redirects. (On Lycos the result in an "Internal Server Error"
735 * report.) In that case you can set DISABLE_HTTP_REDIRECT to true.
736 * (In which case, PhpWiki will revert to sneakier tricks to try to
737 * redirect the browser...)
739 //if (!defined('DISABLE_HTTP_REDIRECT')) define ('DISABLE_HTTP_REDIRECT', true);
741 ////////////////////////////////////////////////////////////////
742 // Check if we were included by some other wiki version
743 // (getimg.php, en, de, wiki, ...) or not.
744 // If the server requested this index.php fire up the code by loading lib/main.php.
745 // Parallel wiki scripts can now simply include /index.php for the
746 // main configuration, extend or redefine some settings and
747 // load lib/main.php by themselves. See the file 'wiki'.
748 // This overcomes the IndexAsConfigProblem.
749 ////////////////////////////////////////////////////////////////
751 // Tested: Works with CGI also.
752 if (defined('VIRTUAL_PATH') and defined('USE_PATH_INFO')) {
753 if ($HTTP_SERVER_VARS['SCRIPT_NAME'] == VIRTUAL_PATH) {
754 include "lib/main.php";
757 if (defined('SCRIPT_NAME') and
758 ($HTTP_SERVER_VARS['SCRIPT_NAME'] == SCRIPT_NAME)) {
759 include "lib/main.php";
760 } elseif (strstr($HTTP_SERVER_VARS['PHP_SELF'],'index.php')) {
761 include "lib/main.php";
765 // (c-file-style: "gnu")
770 // c-hanging-comment-ender-p: nil
771 // indent-tabs-mode: nil
774 // $Log: not supported by cvs2svn $
775 // Revision 1.111 2003/03/18 21:40:04 dairiki
776 // Copy Lawrence's memo on USE_PATH_INFO/AcceptPathInfo to configurator.php
779 // Plus slight clarification of default (auto-detect) behavior.
781 // Revision 1.110 2003/03/18 20:51:10 lakka
782 // Revised comments on use of USE_PATH_INFO with Apache 2
784 // Revision 1.109 2003/03/17 21:24:50 dairiki
785 // Fix security bugs in the RawHtml plugin.
787 // Change the default configuration to allow use of plugin, since
788 // I believe the plugin is now safe for general use. (Raw HTML will only
789 // work on locked pages.)
791 // Revision 1.108 2003/03/07 22:47:01 dairiki
792 // A few more if(!defined(...))'s
794 // Revision 1.107 2003/03/07 20:51:54 dairiki
795 // New feature: Automatic extraction of keywords (for the meta keywords tag)
796 // from Category* and Topic* links on each page.
798 // Revision 1.106 2003/03/07 02:48:23 dairiki
799 // Add option to prevent HTTP redirect.
801 // Revision 1.105 2003/03/04 02:08:08 dairiki
802 // Fix and document the WIKIDB_NOCACHE_MARKUP config define.
804 // Revision 1.104 2003/02/26 02:55:52 dairiki
805 // New config settings in index.php to control cache control strictness.
807 // Revision 1.103 2003/02/22 19:43:50 dairiki
808 // Fix comment regarding connecting to SQL server over a unix socket.
810 // Revision 1.102 2003/02/22 18:53:38 dairiki
811 // Renamed method Request::compress_output to Request::buffer_output.
813 // Added config option to disable compression.
815 // Revision 1.101 2003/02/21 19:29:30 dairiki
816 // Update PHPWIKI_VERSION to 1.3.5pre.
818 // Revision 1.100 2003/01/04 03:36:58 wainstead
819 // Added 'file' as a database type alongside 'dbm'; added cvs log tag