2 # MediaWiki web-based config/installation
3 # Copyright (C) 2004 Brion Vibber <brion@pobox.com>
4 # http://www.mediawiki.org/
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License along
17 # with this program; if not, write to the Free Software Foundation, Inc.,
18 # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 # http://www.gnu.org/copyleft/gpl.html
21 header( "Content-type: text/html; charset=utf-8" );
23 ?
><!DOCTYPE HTML
PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
24 "http://www.w3.org/TR/html4/loose.dtd">
27 <meta http
-equiv
="Content-type" content
="text/html; charset=utf-8">
28 <meta name
="robots" content
="noindex,nofollow">
29 <title
>MediaWiki installation
</title
>
30 <style type
="text/css">
35 background
-color
: #eee;
37 border
: solid
1px
#444;
45 dl
.setup dd label
.column
{
57 /* margin-right: 200px; */
75 <a href
="http://www.mediawiki.org/"><img
76 src
="../stylesheets/images/wiki.png" width
="135" height
="135" alt
="" border
="0" /></a
>
79 <b
><a href
="http://www.mediawiki.org/">MediaWiki
</a
></b
> is
80 Copyright (C
) 2001-2004 by Magnus Manske
, Brion Vibber
, Lee Daniel Crocker
,
81 Tim Starling
, Erik M
ö
;ller
, and others
.</p
>
84 <li
><a href
="../README">Readme
</a
></li
>
85 <li
><a href
="../RELEASE-NOTES">Release notes
</a
></li
>
86 <li
><a href
="../docs/">doc
/</a
></li
>
87 <li
><a href
="http://meta.wikipedia.org/wiki/MediaWiki_User's_Guide">User
's Guide</a></li>
90 <p>This program is free software; you can redistribute it and/or modify
91 it under the terms of the GNU General Public License as published by
92 the Free Software Foundation; either version 2 of the License, or
93 (at your option) any later version.</p>
95 <p>This program is distributed in the hope that it will be useful,
96 but WITHOUT ANY WARRANTY; without even the implied warranty of
97 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
98 GNU General Public License for more details.</p>
100 <p>You should have received <a href="../COPYING">a copy of the GNU General Public License</a>
101 along with this program; if not, write to the Free Software
102 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
103 or <a href="http://www.gnu.org/copyleft/gpl.html">read it online</a></p>
108 $IP = ".."; # Just to suppress notices, not for anything useful
109 define( "MEDIAWIKI", true );
110 define( "MEDIAWIKI_INSTALL", true );
111 require( "../includes/DefaultSettings.php" );
114 <h1>MediaWiki <?php print $wgVersion ?> installation</h1>
119 /* Check for existing configurations and bug out! */
121 if( file_exists( "../LocalSettings.php" ) || file_exists( "../AdminSettings.php" ) ) {
122 dieout( "<h2>Wiki is configured.</h2>
124 <p>Already configured... <a href='../index
.php
'>return to the wiki</a>.</p>
126 <p>(You should probably remove this directory for added security.)</p>" );
129 if( file_exists( "./LocalSettings.php" ) || file_exists( "./AdminSettings.php" ) ) {
130 dieout( "<h2>You're configured
!</h2
>
132 <p
>Please move
<tt
>LocalSettings
.php
</tt
> to the parent directory
, then
133 <a href
='../index.php'>try out your wiki
</a
>.
134 (You should remove this config directory
for added security once you
're done.)</p>" );
137 if( !is_writable( "." ) ) {
138 dieout( "<h2>Can't write config file
, aborting
</h2
>
140 <p
>In order to configure the wiki you have to make the
<tt
>config
</tt
> subdirectory
141 writable by the web server
. Once configuration is done you
'll move the created
142 <tt>LocalSettings.php</tt> to the parent directory, and for added safety you can
143 then remove the <tt>config</tt> subdirectory entirely.</p>
145 <p>To make the directory writable on a Unix/Linux system:</p>
148 cd <i>/path/to/wiki</i>
154 require( "../install-utils.inc" );
155 require( "../maintenance/updaters.inc" );
156 require( "../maintenance/convertLinks.inc" );
157 require( "../maintenance/archives/moveCustomMessages.inc" );
160 function getEncoded( $data ) {
162 global $wgInputEncoding;
163 if( strcasecmp( $wgInputEncoding, "utf-8" ) == 0 ) {
166 return utf8_decode( $data ); /* to latin1 wikis */
169 function getSitename() { return $this->getEncoded( $this->Sitename ); }
170 function getSysopName() { return $this->getEncoded( $this->SysopName ); }
171 function getSysopPass() { return $this->getEncoded( $this->SysopPass ); }
176 <p><i>Please include all of the lines below when reporting installation problems.</i></p>
178 <h2>Checking environment...</h2>
183 $conf = new ConfigData;
185 install_version_checks();
186 print "<li>PHP " . phpversion() . " ok</li>\n";
188 $sapi = php_sapi_name();
189 $conf->prettyURLs = true;
190 print "<li>PHP server API is $sapi; ";
193 case "apache2handler":
194 print "ok, using pretty URLs (<tt>index.php/Page_Title</tt>)";
198 case "apache2filter":
199 print "using ugly URLs (<tt>index.php?title=Page_Title</tt>)";
200 $conf->prettyURLs = false;
203 print "unknown; using pretty URLs (<tt>index.php/Page_Title</tt>), if you have trouble change this in <tt>LocalSettings.php</tt>";
207 $conf->zlib = function_exists( "gzencode" );
209 print "<li>Have zlib support; enabling output compression.</li>\n";
211 print "<li>No zlib support.</li>\n";
214 $conf->ImageMagick = false;
216 $conf->HaveGD = function_exists( "imagejpeg" );
217 if( $conf->HaveGD ) {
218 print "<li>Found GD graphics library built-in, image thumbnailing will be enabled if you enable uploads.</li>\n";
220 $imcheck = array( "/usr/bin", "/usr/local/bin", "/sw/bin" );
221 foreach( $imcheck as $dir ) {
222 $im = "$dir/convert";
223 if( file_exists( $im ) ) {
224 print "<li>Found ImageMagick: <tt>$im</tt>; image thumbnailing will be enabled if you enable uploads.</li>\n";
225 $conf->ImageMagick = $im;
229 if( !$conf->ImageMagick ) {
230 print "<li>Couldn't find GD library
or ImageMagick
; image thumbnailing disabled
.</li
>\n";
234 $conf->UseImageResize = $conf->HaveGD || $conf->ImageMagick;
236 # $conf->IP = "/Users
/brion
/Sites
/inplace
";
238 $conf->IP = getcwd();
239 $conf->IP = preg_replace( "/\\\\/","\\\\\\\\
",$conf->IP ); // For Windows, \ -> \\
241 print "<li
>Installation directory
: <tt
>" . htmlspecialchars( $conf->IP ) . "</tt
></li
>\n";
243 # $conf->ScriptPath = "/~brion
/inplace
";
244 $conf->ScriptPath = preg_replace( '{^(.*)/config.*$}', '$1', $_SERVER["REQUEST_URI
"] );
245 print "<li
>Script URI path
: <tt
>" . htmlspecialchars( $conf->ScriptPath ) . "</tt
></li
>\n";
247 $conf->posted = ($_SERVER["REQUEST_METHOD
"] == "POST
");
249 $conf->Sitename = ucfirst( importPost( "Sitename
", "" ) );
250 $conf->EmergencyContact = importPost( "EmergencyContact
", $_SERVER["SERVER_ADMIN
"] );
251 $conf->DBserver = importPost( "DBserver
", "localhost
" );
252 $conf->DBname = importPost( "DBname
", "wikidb
" );
253 $conf->DBuser = importPost( "DBuser
", "wikiuser
" );
254 $conf->DBpassword = importPost( "DBpassword
" );
255 $conf->DBpassword2 = importPost( "DBpassword2
" );
256 $conf->RootPW = importPost( "RootPW
" );
257 $conf->LanguageCode = importPost( "LanguageCode
", "en
-utf8
" );
258 $conf->SysopName = importPost( "SysopName
", "WikiSysop
" );
259 $conf->SysopPass = importPost( "SysopPass
" );
260 $conf->SysopPass2 = importPost( "SysopPass2
" );
262 /* Check for validity */
265 if( $conf->Sitename == "" || $conf->Sitename == "MediaWiki
" || $conf->Sitename == "Mediawiki
" ) {
266 $errs["Sitename
"] = "Must not be blank
or \"MediaWiki\"
.";
268 if( $conf->DBpassword == "" ) {
269 $errs["DBpassword
"] = "Must not be blank
";
271 if( $conf->DBpassword != $conf->DBpassword2 ) {
272 $errs["DBpassword2
"] = "Passwords don
't match!";
275 if( $conf->SysopPass == "" ) {
276 $errs["SysopPass"] = "Must not be blank";
278 if( $conf->SysopPass != $conf->SysopPass2 ) {
279 $errs["SysopPass2"] = "Passwords don't match
!";
282 $conf->License = importPost( "License
", "none
" );
283 if( $conf->License == "gfdl
" ) {
284 $conf->RightsUrl = "http
://www.gnu.org/copyleft/fdl.html";
285 $conf->RightsText
= "GNU Free Documentation License 1.2";
286 $conf->RightsCode
= "gfdl";
287 $conf->RightsIcon
= "{$conf->ScriptPath}/stylesheets/images/gnu-fdl.png";
288 } elseif( $conf->License
== "none" ) {
289 $conf->RightsUrl
= $conf->RightsText
= $conf->RightsCode
= $conf->RightsIcon
= "";
291 $conf->RightsUrl
= importPost( "RightsUrl", "" );
292 $conf->RightsText
= importPost( "RightsText", "" );
293 $conf->RightsCode
= importPost( "RightsCode", "" );
294 $conf->RightsIcon
= importPost( "RightsIcon", "" );
297 if( $conf->posted
&& ( 0 == count( $errs ) ) ) {
298 do { /* So we can 'continue' to end prematurely */
299 $conf->Root
= ($conf->RootPW
!= "");
301 /* Load up the settings and get installin' */
302 $local = writeLocalSettings( $conf );
303 $wgCommandLineMode = false;
306 $wgDBadminuser = $wgDBuser;
307 $wgDBadminpassword = $wgDBpassword;
308 $wgCommandLineMode = true;
309 $wgUseDatabaseMessages = false; /* FIXME: For database failure */
310 require_once( "includes/Setup.php" );
313 require_once( "../maintenance/InitialiseMessages.inc" );
315 $wgTitle = Title
::newFromText( "Installation script" );
316 $wgDatabase = Database
::newFromParams( $wgDBserver, "root", $conf->RootPW
, "", 1 );
317 $wgDatabase->mIgnoreErrors
= true;
319 @$myver = mysql_get_server_info( $wgDatabase->mConn
);
322 print "<li>Connected as root (automatic)</li>\n";
324 print "<li>MySQL error " . ($err = mysql_errno() ) .
325 ": " . htmlspecialchars( mysql_error() );
330 $errs["RootPW"] = "Check password";
332 print "<li>Trying regular user...\n";
333 /* Try the regular user... */
334 $wgDatabase = Database
::newFromParams( $wgDBserver, $wgDBuser, $wgDBpassword, "", 1 );
335 $wgDatabase->isOpen();
336 $wgDatabase->mIgnoreErrors
= true;
337 @$myver = mysql_get_server_info( $wgDatabase->mConn
);
339 $errs["DBuser"] = "Check name/pass";
340 $errs["DBpassword"] = "or enter root";
341 $errs["DBpassword2"] = "password below";
342 $errs["RootPW"] = "Got root?";
343 print " need password.</li>\n";
355 $errs["DBserver"] = "Connection failed";
358 $errs["DBserver"] = "Couldn't connect to database";
364 if ( !$wgDatabase->isOpen() ) {
365 $errs["DBserver"] = "Couldn't connect to database";
369 print "<li>Connected to database... $myver";
370 if( version_compare( $myver, "4.0.0" ) >= 0 ) {
371 print "; enabling MySQL 4 enhancements";
372 $conf->DBmysql4
= true;
373 $local = writeLocalSettings( $conf );
377 @$sel = mysql_select_db( $wgDBname, $wgDatabase->mConn
);
379 print "<li>Database <tt>" . htmlspecialchars( $wgDBname ) . "</tt> exists</li>\n";
381 $res = $wgDatabase->query( "CREATE DATABASE `$wgDBname`" );
383 print "<li>Couldn't create database <tt>" .
384 htmlspecialchars( $wgDBname ) .
385 "</tt>; try with root access or check your username/pass.</li>\n";
386 $errs["RootPW"] = "<- Enter";
389 print "<li>Created database <tt>" . htmlspecialchars( $wgDBname ) . "</tt></li>\n";
392 $wgDatabase->selectDB( $wgDBname );
394 if( $wgDatabase->tableExists( "cur" ) ) {
395 print "<li>There are already MediaWiki tables in this database. Checking if updates are needed...</li>\n<pre>";
399 do_ipblocks_update(); flush();
400 do_interwiki_update(); flush();
401 do_index_update(); flush();
402 do_linkscc_update(); flush();
403 do_linkscc_1_3_update(); flush();
404 do_hitcounter_update(); flush();
405 do_recentchanges_update(); flush();
406 convertLinks(); flush();
407 do_user_real_name_update(); flush();
408 do_querycache_update(); flush();
409 do_objectcache_update(); flush();
410 do_categorylinks_update(); flush();
412 if ( isTemplateInitialised() ) {
413 print "Template namespace already initialised\n";
415 moveCustomMessages( 1 ); flush();
416 moveCustomMessages( 2 ); flush();
417 moveCustomMessages( 3 ); flush();
420 initialiseMessages(); flush();
424 print "<li>Finished update checks.</li>\n";
426 # FIXME: Check for errors
427 print "<li>Creating tables...";
428 dbsource( "../maintenance/tables.sql", $wgDatabase );
429 dbsource( "../maintenance/interwiki.sql", $wgDatabase );
430 dbsource( "../maintenance/indexes.sql", $wgDatabase );
431 print " done.</li>\n";
433 print "<li>Initializing data...";
434 $wgDatabase->query( "INSERT INTO site_stats (ss_row_id,ss_total_views," .
435 "ss_total_edits,ss_good_articles) VALUES (1,0,0,0)" );
437 if( $conf->SysopName
) {
438 $u = User
::newFromName( $conf->getSysopName() );
439 if ( 0 == $u->idForName() ) {
441 $u->setPassword( $conf->getSysopPass() );
442 $u->addRight( "sysop" );
443 $u->addRight( "bureaucrat" );
445 print "<li>Created sysop account <tt>" .
446 htmlspecialchars( $conf->SysopName
) . "</tt>.</li>\n";
448 print "<li>Could not create user - already exists!</li>\n";
451 print "<li>Skipped sysop account creation, no name given.</li>\n";
454 print "<li>Initialising log pages...";
456 "uploadlogpage" => "uploadlogpagetext",
457 "dellogpage" => "dellogpagetext",
458 "protectlogpage" => "protectlogtext",
459 "blocklogpage" => "blocklogtext"
461 $metaNamespace = Namespace::getWikipedia();
462 $now = wfTimestampNow();
463 $won = wfInvertTimestamp( $now );
464 foreach( $logs as $page => $text ) {
465 $logTitle = wfStrencode( $wgLang->ucfirst( str_replace( " ", "_", wfMsgNoDB( $page ) ) ) );
466 $logText = wfStrencode( wfMsgNoDB( $text ) );
467 $wgDatabase->query( "INSERT INTO cur (cur_namespace,cur_title,cur_text," .
468 "cur_restrictions,cur_timestamp,inverse_timestamp,cur_touched) " .
469 "VALUES ($metaNamespace,'$logTitle','$logText','sysop','$now','$won','$now')" );
473 $titleobj = Title
::newFromText( wfMsgNoDB( "mainpage" ) );
474 $title = $titleobj->getDBkey();
475 $sql = "INSERT INTO cur (cur_namespace,cur_title,cur_text,cur_timestamp,inverse_timestamp,cur_touched) " .
476 "VALUES (0,'$title','" .
477 wfStrencode( wfMsg( "mainpagetext" ) . "\n\n" . wfMsg( "mainpagedocfooter" ) ) . "','$now','$won','$now')";
478 $wgDatabase->query( $sql, $fname );
481 initialiseMessages();
482 print "</pre></li>\n";
485 print "<li>Granting user permissions...</li>\n";
486 dbsource( "../maintenance/users.sql", $wgDatabase );
490 /* Write out the config file now that all is well */
491 print "<p>Creating LocalSettings.php...</p>\n\n";
492 $localSettings = "<" . "?php$endl$local$endl?" . ">";
494 if( version_compare( phpversion(), "4.3.2" ) >= 0 ) {
495 $xt = "xt"; # Refuse to overwrite an existing file
497 $xt = "wt"; # 'x' is not available prior to PHP 4.3.2. We did check above, but race conditions blah blah
499 $f = fopen( "LocalSettings.php", $xt );
502 dieout( "<p>Couldn't write out LocalSettings.php. Check that the directory permissions are correct and that there isn't already a file of that name here...</p>\n" .
503 "<p>Here's the file that would have been written, try to paste it into place manually:</p>\n" .
504 "<pre>\n" . htmlspecialchars( $localSettings ) . "</pre>\n" );
506 fwrite( $f, $localSettings );
509 print "<p>Success! Move the LocalSettings.php file into the parent directory, then follow
510 <a href='{$conf->ScriptPath}/index.php'>this link</a> to your wiki.</p>\n";
520 if( count( $errs ) ) {
521 /* Display options form */
523 if( $conf->posted
) {
524 echo "<p class='error'>Something's not quite right yet; make sure everything below is filled out correctly.</p>\n";
528 <form name
="config" method
="post">
536 aField( $conf, "Sitename", "Site name:" );
540 Your site name should be a relatively short word
. It
'll appear as the namespace
541 name for 'meta
' pages as well as throughout the user interface. Good site names
542 are things like "<a href="http://www.wikipedia.org/">Wikipedia</a>" and
543 "<a href="http://openfacts.berlios.de/">OpenFacts</a>"; avoid punctuation,
544 which may cause problems.
549 aField( $conf, "EmergencyContact", "Contact e-mail" );
553 This will be used as the return address for password reminders and
554 may be displayed in some error conditions so visitors can get in
559 <label class='column
' for="LanguageCode">Language</label>
560 <select id="LanguageCode" name="LanguageCode">
562 $list = getLanguageList();
563 foreach( $list as $code => $name ) {
564 $sel = ($code == $conf->LanguageCode) ? "selected" : "";
565 echo "\t\t<option value=\"$code\" $sel>$name</option>\n";
571 You may select the language for the user interface of the wiki...
572 Some localizations are less complete than others. This also controls
573 the character encoding; Unicode is more flexible, but Latin-1 may be
574 more compatible with older browsers for some languages. Unicode will
575 be used where not specified otherwise.
579 <label class='column
'>Copyright/license metadata</label>
580 <div>Select one:</div>
583 <li><?php aField( $conf, "License", "no license metadata", "radio", "none" ); ?></li>
584 <li><?php aField( $conf, "License", "GNU Free Documentation License 1.2 (Wikipedia-compatible)", "radio", "gfdl" ); ?></li>
586 aField( $conf, "License", "a Creative Commons license...", "radio", "cc" );
587 $partner = "MediaWiki";
588 $exit = urlencode( "$wgServer{$conf->ScriptPath}/config/index.php?License=cc&RightsUrl=[license_url]&RightsText=[license_name]&RightsCode=[license_code]&RightsIcon=[license_button]" );
589 $icon = urlencode( "$wgServer$wgUploadPath/wiki.png" );
590 $ccApp = htmlspecialchars( "http://creativecommons.org/license/?partner=$partner&exit_url=$exit&partner_icon_url=$icon" );
591 print "<a href=\"$ccApp\">choose</a>";
593 <li><?php aField( $conf, "RightsUrl", $conf->RightsUrl, "hidden" ); ?></li>
594 <li><?php aField( $conf, "RightsText", $conf->RightsText, "hidden" ); ?></li>
595 <li><?php aField( $conf, "RightsCode", $conf->RightsCode, "hidden" ); ?></li>
596 <li><?php aField( $conf, "RightsIcon", $conf->RightsIcon, "hidden" ); ?></li>
600 MediaWiki can include a basic license notice, icon, and machine-reable
601 copyright metadata if your wiki's content is to be licensed under
602 the GNU FDL
or a Creative Commons license
. If you
're not sure, leave
608 <?php aField( $conf, "SysopName", "Sysop account name:", "" ) ?>
611 <?php aField( $conf, "SysopPass", "password:", "password" ) ?>
614 <?php aField( $conf, "SysopPass2", "again:", "password" ) ?>
617 A sysop user account can lock or delete pages, block problematic IP
618 addresses from editing, and other maintenance tasks. If creating a new
619 wiki database, a sysop account will be created with the given name
624 <h2>Database config</h2>
628 aField( $conf, "DBserver", "MySQL server" );
631 If your database server isn't on your web server
, enter the name
636 aField( $conf, "DBname", "Database name" );
639 aField( $conf, "DBuser", "DB username" );
642 aField( $conf, "DBpassword", "DB password", "password" );
645 aField( $conf, "DBpassword2", "again", "password" );
648 If you only have a single user account
and database available
,
649 enter those here
. If you have database root
access (see below
)
650 you can specify
new accounts
/databases to be created
.
656 aField( $conf, "RootPW", "DB root password", "password" );
660 You will only need this
if the database
and/or user account
661 above don
't already exist.
662 Do <em>not</em> type in your machine's root password
! MySQL
663 has its own
"root" user with a separate password
. (It might
664 even be blank
, depending on your configuration
.)
668 <label
class='column'> 
;</label
>
669 <input type
="submit" value
="Install!" />
679 /* -------------------------------------------------------------------------------------- */
681 function writeAdminSettings( $conf ) {
683 \$wgDBadminuser = \"{$conf->DBadminuser}\";
684 \$wgDBadminpassword = \"{$conf->DBadminpassword}\";
688 function writeLocalSettings( $conf ) {
689 $conf->DBmysql4
= @$conf->DBmysql4 ?
'true' : 'false';
690 $conf->UseImageResize
= $conf->UseImageResize ?
'true' : 'false';
691 $conf->PasswordSender
= $conf->EmergencyContact
;
692 if( $conf->LanguageCode
== "en-utf8" ) {
693 $conf->LanguageCode
= "en";
694 $conf->Encoding
= "UTF-8";
696 $zlib = ($conf->zlib ?
"" : "# ");
697 $magic = ($conf->ImageMagick ?
"" : "# ");
698 $convert = ($conf->ImageMagick ?
$conf->ImageMagick
: "/usr/bin/convert" );
699 $pretty = ($conf->prettyURLs ?
"" : "# ");
700 $ugly = ($conf->prettyURLs ?
"# " : "");
701 $rights = ($conf->RightsUrl
) ?
"" : "# ";
703 $file = @fopen
( "/dev/random", "r" );
705 $proxyKey = bin2hex( fread( $file, 32 ) );
709 for ( $i=0; $i<8; $i++
) {
710 $proxyKey .= dechex(mt_rand(0, 0x7fffffff));
712 print "Warning: \$wgProxyKey is insecure\n";
715 # Add slashes to strings for double quoting
716 $slconf = array_map( "addslashes", get_object_vars( $conf ) );
719 $sep = (DIRECTORY_SEPARATOR
== "\\") ?
";" : ":";
721 # This file was automatically generated by the MediaWiki installer.
722 # If you make manual changes, please keep track in case you need to
723 # recreate them later.
725 \$IP = \"{$slconf['IP']}\";
726 ini_set( \"include_path\", \"\$IP/includes$sep\$IP/languages$sep\" . ini_get(\"include_path\") );
727 include_once( \"DefaultSettings.php\" );
729 if ( \$wgCommandLineMode ) {
730 if ( isset( \$_SERVER ) && array_key_exists( 'REQUEST_METHOD', \$_SERVER ) ) {
731 die( \"This script must be run from the command line\\n\" );
734 ## Compress output if the browser supports it
735 {$zlib}if( !ini_get( 'zlib.output_compression' ) ) ob_start( 'ob_gzhandler' );
738 \$wgSitename = \"{$slconf['Sitename']}\";
740 \$wgScriptPath = \"{$slconf['ScriptPath']}\";
741 \$wgScript = \"\$wgScriptPath/index.php\";
742 \$wgRedirectScript = \"\$wgScriptPath/redirect.php\";
744 ## If using PHP as a CGI module, use the ugly URLs
745 {$pretty}\$wgArticlePath = \"\$wgScript/\$1\";
746 {$ugly}\$wgArticlePath = \"\$wgScript?title=\$1\";
748 \$wgStylePath = \"\$wgScriptPath/stylesheets\";
749 \$wgStyleDirectory = \"\$IP/stylesheets\";
750 \$wgLogo = \"\$wgStylePath/images/wiki.png\";
752 \$wgUploadPath = \"\$wgScriptPath/images\";
753 \$wgUploadDirectory = \"\$IP/images\";
755 \$wgEmergencyContact = \"{$slconf['EmergencyContact']}\";
756 \$wgPasswordSender = \"{$slconf['PasswordSender']}\";
758 \$wgDBserver = \"{$slconf['DBserver']}\";
759 \$wgDBname = \"{$slconf['DBname']}\";
760 \$wgDBuser = \"{$slconf['DBuser']}\";
761 \$wgDBpassword = \"{$slconf['DBpassword']}\";
763 ## To allow SQL queries through the wiki's Special:Askaql page,
764 ## uncomment the next lines. THIS IS VERY INSECURE. If you want
765 ## to allow semipublic read-only SQL access for your sysops,
766 ## you should define a MySQL user with limited privileges.
767 ## See MySQL docs: http://www.mysql.com/doc/en/GRANT.html
769 # \$wgAllowSysopQueries = true;
770 # \$wgDBsqluser = \"sqluser\";
771 # \$wgDBsqlpassword = \"sqlpass\";
773 \$wgDBmysql4 = \$wgEnablePersistentLC = {$conf->DBmysql4};
775 ## To enable image uploads, make sure the 'images' directory
776 ## is writable, then uncomment this:
777 # \$wgDisableUploads = false;
778 \$wgUseImageResize = {$conf->UseImageResize};
779 {$magic}\$wgUseImageMagick = true;
780 {$magic}\$wgImageMagickConvertCommand = \"{$convert}\";
782 ## If you have the appropriate support software installed
783 ## you can enable inline LaTeX equations:
785 \$wgMathPath = \"{\$wgUploadPath}/math\";
786 \$wgMathDirectory = \"{\$wgUploadDirectory}/math\";
787 \$wgTmpDirectory = \"{\$wgUploadDirectory}/tmp\";
789 \$wgLocalInterwiki = \$wgSitename;
791 \$wgLanguageCode = \"{$slconf['LanguageCode']}\";
792 " . ($conf->Encoding ?
"\$wgInputEncoding = \$wgOutputEncoding = \"{$slconf['Encoding']}\";" : "" ) . "
794 \$wgProxyKey = \"$proxyKey\";
796 ## Default skin: you can change the default skin. Use the internal symbolic
797 ## names, ie 'standard', 'nostalgia', 'cologneblue', 'monobook':
798 # \$wgDefaultSkin = 'monobook';
800 ## For attaching licensing metadata to pages, and displaying an
801 ## appropriate copyright notice / icon. GNU Free Documentation
802 ## License and Creative Commons licenses are supported so far.
803 {$rights}\$wgEnableCreativeCommonsRdf = true;
804 \$wgRightsPage = \"\"; # Set to the title of a wiki page that describes your license/copyright
805 \$wgRightsUrl = \"{$conf->RightsUrl}\";
806 \$wgRightsText = \"{$conf->RightsText}\";
807 \$wgRightsIcon = \"{$conf->RightsIcon}\";
808 # \$wgRightsCode = \"{$conf->RightsCode}\"; # Not yet used
812 function dieout( $text ) {
813 die( $text . "\n\n</body>\n</html>" );
816 function importPost( $name, $default = "" ) {
817 if( isset( $_POST[$name] ) ) {
818 $retval = $_POST[$name];
819 if ( get_magic_quotes_gpc() ) {
820 $retval = stripslashes( $retval );
828 function aField( &$conf, $field, $text, $type = "", $value = "" ) {
830 $xtype = "type=\"$type\"";
835 if(!(isset($id)) or ($id == "") ) $id = $field;
836 $nolabel = ($type == "radio") ||
($type == "hidden");
840 echo "\t\t<label class='column' for=\"$id\">$text</label>\n";
843 if( $type == "radio" && $value == $conf->$field ) {
844 $checked = "checked='checked'";
848 echo "\t\t<input $xtype name=\"$field\" id=\"$id\" $checked value=\"";
849 if( $type == "radio" ) {
850 echo htmlspecialchars( $value );
852 echo htmlspecialchars( $conf->$field );
856 echo " $text</label>\n";
860 if(isset($errs[$field])) echo "<span class='error'>" . $errs[$field] . "</span>\n";
863 function getLanguageList() {
864 global $wgLanguageNames;
865 if( !isset( $wgLanguageNames ) ) {
866 $wgLanguageCode = "xxx";
867 function wfLocalUrl( $x ) { return $x; }
868 function wfLocalUrlE( $x ) { return $x; }
869 require( "../languages/Language.php" );
873 $latin1 = array( "da", "de", "en", "es", "nl", "sv" );
875 $d = opendir( "../languages" );
876 while( false !== ($f = readdir( $d ) ) ) {
877 if( preg_match( '/Language([A-Z][a-z]+)\.php$/', $f, $m ) ) {
878 $code = strtolower( $m[1] );
879 $codes[$code] = "$code - " . $wgLanguageNames[$code];
880 if( in_array( $code, $latin1 ) ) {
881 $codes[$code] .= " - Latin-1";
885 $codes["en-utf8"] = "en - English - Unicode";