]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - lib/config.php
Changed back to dynamically setting the hostname; using 'http:' is
[SourceForge/phpwiki.git] / lib / config.php
1 <?php
2    if (!function_exists('rcs_id')) {
3       function rcs_id($id) { echo "<!-- $id -->\n"; };
4    }
5    rcs_id('$Id: config.php,v 1.5 2000-10-10 02:59:08 wainstead Exp $');
6
7    /*
8       Constants and settings. Edit the values below for
9       your site. You need two image files, a banner and 
10       a signature. The dbm file MUST be writable by the
11       web server or this won't work. If you configure your
12       server to allow index.php as an index file, you 
13       can just give the URL without the script name.
14    */
15
16    // If you need to access your Wiki from assorted locations and
17    // you use DHCP, this setting might work for you:
18
19    //$ServerAddress = "http:";
20
21    // It works quite well thanks to relative URIs. (Yes, that's just
22    // 'http:'). If find that you want an explicit address (recommended), 
23    // you can set one yourself by changing and uncommenting:
24
25    //$ServerAddress = "http://your.hostname.org/phpwiki/";
26
27    // Or you could use the if/else statement below to deduce
28    // the $ServerAddress dynamically. (Default)
29
30    if (preg_match("#(.*?)([^/]*$)#", $REQUEST_URI, $matches)) {
31       $ServerAddress = "http://$SERVER_NAME:$SERVER_PORT" . $matches[1];
32    } else {
33       $ServerAddress = "http://$SERVER_NAME:$SERVER_PORT$REQUEST_URI";
34    }
35
36
37
38    // if you are using MySQL instead of a DBM to store your
39    // Wiki pages, use mysql.php instead of dbmlib.php
40    // See INSTALL.mysql for details on using MySQL
41
42    // if you are using Postgressl instead of a DBM to store your
43    // Wiki pages, use pgsql.php instead of dbmlib.php
44    // See INSTALL.pgsql for details on using Postgresql
45
46    // if you are using mSQL instead of a DBM to store your
47    // Wiki pages, use msql.php instead of dbmlib.php
48    // See INSTALL.mysql for details on using mSQL
49
50
51    // DBM settings (default)
52    include "lib/dbmlib.php";
53    $DBMdir = "/tmp";
54    $WikiPageStore = "wiki";
55    $ArchivePageStore = "archive";
56    $WikiDB['wiki']      = "$DBMdir/wikipagesdb";
57    $WikiDB['archive']   = "$DBMdir/wikiarchivedb";
58    $WikiDB['wikilinks'] = "$DBMdir/wikilinksdb";
59    $WikiDB['hottopics'] = "$DBMdir/wikihottopicsdb";
60    $WikiDB['hitcount']  = "$DBMdir/wikihitcountdb";
61
62 /*
63    // MySQL settings (thanks Arno Hollosi! <ahollosi@iname.com>)
64    // Comment out the lines above (for the DBM) if you use these
65
66    include "lib/mysql.php";
67    $WikiPageStore = "wiki";
68    $ArchivePageStore = "archive";
69    $mysql_server = 'localhost';
70    $mysql_user = 'root';
71    $mysql_pwd = '';
72    $mysql_db = 'wiki';
73 */
74
75 /*
76    // PostgreSQL settings. 
77    include "lib/pgsql.php";
78    $WikiDataBase  = "wiki"; // name of the database in Postgresql
79    $WikiPageStore = "wiki"; // name of the table where pages are stored
80    $ArchivePageStore = "archive"; // name of the table where pages are archived
81    $pg_dbhost    = "localhost";
82    $pg_dbport    = "5432";
83 */
84
85
86 /*
87    // MiniSQL (mSQL) settings.
88    include "lib/msql.php";
89    $msql_db = "wiki";
90    // should be the same as wikipages.line
91    define("MSQL_MAX_LINE_LENGTH", 128);
92    $WikiPageStore = array();
93    $ArchivePageStore = array();
94
95    $WikiPageStore['table']         = "wiki";
96    $WikiPageStore['page_table']    = "wikipages";
97    $ArchivePageStore['table']      = "archive";
98    $ArchivePageStore['page_table'] = "archivepages";
99    // end mSQL settings
100 */
101
102 /*
103    // Filesystem DB settings
104    include "lib/db_filesystem.php";
105    $DBdir = "/tmp/wiki";
106    $WikiPageStore = "wiki";
107    $ArchivePageStore = "archive";
108    $WikiDB['wiki']      = "$DBdir/pages";
109    $WikiDB['archive']   = "$DBdir/archive";
110    $WikiDB['wikilinks'] = "$DBdir/links";
111    $WikiDB['hottopics'] = "$DBdir/hottopics";
112    $WikiDB['hitcount']  = "$DBdir/hitcount";
113    // End Filsystem Settings
114 */
115
116
117    /* WIKI_PGSRC
118     *
119     * This constant specifies the source for the initial page contents
120     * of the Wiki.  The setting of WIKI_PGSRC only has effect when
121     * the wiki is accessed for the first time (or after clearing the
122     * database.)
123     *
124     * The WIKI_PGSRC can either name a directory or a zip file.
125     * In either case WIKI_PGSRC is scanned for files --- one file per page.
126     *
127     * FIXME: this documentation needs to be clarified.
128     *
129     * If the files appear to be MIME formatted messages, they are
130     * scanned for application/x-phpwiki content-types.  Any suitable
131     * content is added to the wiki.
132     *
133     * The files can also be plain text files, in which case the page name
134     * is taken from the file name.
135     */
136    define('WIKI_PGSRC', './pgsrc'); // Default (old) behavior.
137    //define('WIKI_PGSRC', './wiki.zip'); // New style.
138   
139    $ScriptName = "index.php";
140
141
142    // Template files (filenames are relative to script position)
143    $templates = array(
144         "BROWSE" =>    "templates/browse.html",
145         "EDITPAGE" =>  "templates/editpage.html",
146         "EDITLINKS" => "templates/editlinks.html",
147         "MESSAGE" =>   "templates/message.html"
148         );
149
150    $SignatureImg = "images/signature.png";
151    $logo = "images/wikibase.png";
152
153    // date & time formats used to display modification times, etc.
154    // formats are given as format strings to PHP date() function
155    $datetimeformat = "F j, Y";  // may contain time of day
156    $dateformat = "F j, Y";      // must not contain time
157
158    // allowed protocols for links - be careful not to allow "javascript:"
159    $AllowedProtocols = "http|https|mailto|ftp|news|gopher";
160    
161    // you shouldn't have to edit anyting below this line
162
163    $ScriptUrl = $ServerAddress . $ScriptName;
164    $LogoImage = "<img src='${ServerAddress}$logo' border='0'>";
165    $LogoImage = "<a href='$ScriptUrl'>$LogoImage</a>";
166
167    $FieldSeparator = "\263";
168
169    // Apache won't show REMOTE_HOST unless the admin configured it
170    // properly. We'll be nice and see if it's there.
171    empty($REMOTE_HOST) ?
172       ($remoteuser = $REMOTE_ADDR) : ($remoteuser = $REMOTE_HOST);
173
174
175    // number of user-defined external links, i.e. "[1]"
176    define("NUM_LINKS", 12);
177
178    // try this many times if the dbm is unavailable
179    define("MAX_DBM_ATTEMPTS", 20);
180
181    // constants used for HTML output. List tags like UL and 
182    // OL have a depth of one, PRE has a depth of 0.
183    define("ZERO_DEPTH", 0);
184    define("SINGLE_DEPTH", 1);
185
186    // constants for flags in $pagehash
187    define("FLAG_PAGE_LOCKED", 1);
188
189    // this defines how many page names to list when displaying
190    // the MostPopular pages; i.e. setting this to 20 will show
191    // the 20 most popular pages
192    define("MOST_POPULAR_LIST_LENGTH", 20);
193
194    // this defines how many page names to list when displaying
195    // scored related pages
196    define("NUM_RELATED_PAGES", 5);
197
198 ?>