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
="../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 include( "../includes/DefaultSettings.php" );
112 <h1>MediaWiki <?php print $wgVersion ?> installation</h1>
117 /* Check for existing configurations and bug out! */
119 if( file_exists( "../LocalSettings.php" ) || file_exists( "../AdminSettings.php" ) ) {
120 dieout( "<h2>Wiki is configured.</h2>
122 <p>Already configured... <a href='../index
.php
'>return to the wiki</a>.</p>
124 <p>(You should probably remove this directory for added security.)</p>" );
127 if( file_exists( "./LocalSettings.php" ) || file_exists( "./AdminSettings.php" ) ) {
128 dieout( "<h2>You're configured
!</h2
>
130 <p
>Please move
<tt
>LocalSettings
.php
</tt
> to the parent directory
, then
131 <a href
='../index.php'>try out your wiki
</a
>.
132 (You should remove this config directory
for added security once you
're done.)</p>" );
135 if( !is_writable( "." ) ) {
136 dieout( "<h2>Can't write config file
, aborting
</h2
>
138 <p
>In order to configure the wiki you have to make the
<tt
>config
</tt
> subdirectory
139 writable by the web server
. Once configuration is done you
'll move the created
140 <tt>LocalSettings.php</tt> to the parent directory, and for added safety you can
141 then remove the <tt>config</tt> subdirectory entirely.</p>
143 <p>To make the directory writable on a Unix/Linux system:</p>
146 cd <i>/path/to/wiki</i>
152 include( "../install-utils.inc" );
153 include( "../maintenance/updaters.inc" );
155 function getEncoded( $data ) {
157 global $wgInputEncoding;
158 if( strcasecmp( $wgInputEncoding, "utf-8" ) == 0 ) {
161 return utf8_decode( $data ); /* to latin1 wikis */
164 function getSitename() { return $this->getEncoded( $this->Sitename ); }
165 function getSysopName() { return $this->getEncoded( $this->SysopName ); }
166 function getSysopPass() { return $this->getEncoded( $this->SysopPass ); }
172 <h2>Checking environment...</h2>
177 $conf = new ConfigData;
179 install_version_checks();
180 print "<li>PHP " . phpversion() . " ok</li>\n";
182 $sapi = php_sapi_name();
183 $conf->prettyURLs = true;
184 print "<li>PHP server API is $sapi; ";
187 print "ok, using pretty URLs (<tt>index.php/Page_Title</tt>)";
191 case "apache2filter":
192 print "using ugly URLs (<tt>index.php?title=Page_Title</tt>)";
193 $conf->prettyURLs = false;
196 print "unknown; using pretty URLs (<tt>index.php/Page_Title</tt>), if you have trouble change this in <tt>LocalSettings.php</tt>";
200 $conf->zlib = function_exists( "gzencode" );
202 print "<li>Have zlib support; enabling output compression.</li>\n";
204 print "<li>No zlib support.</li>\n";
207 $conf->ImageMagick = false;
209 $conf->HaveGD = function_exists( "imagejpeg" );
210 if( $conf->HaveGD ) {
211 print "<li>Found GD graphics library built-in, image thumbnailing will be enabled if you enable uploads.</li>\n";
213 $imcheck = array( "/usr/bin", "/usr/local/bin", "/sw/bin" );
214 foreach( $imcheck as $dir ) {
215 $im = "$dir/convert";
216 if( file_exists( $im ) ) {
217 print "<li>Found ImageMagick: <tt>$im</tt>; image thumbnailing will be enabled if you enable uploads.</li>\n";
218 $conf->ImageMagick = $im;
222 if( !$conf->ImageMagick ) {
223 print "<li>Couldn't find GD library
or ImageMagick
; image thumbnailing disabled
.</li
>\n";
227 $conf->UseImageResize = $conf->HaveGD || $conf->ImageMagick;
229 # $conf->IP = "/Users
/brion
/Sites
/inplace
";
231 $conf->IP = getcwd();
232 $conf->IP = preg_replace( "/\\\\/","\\\\\\\\
",$conf->IP ); // For Windows, \ -> \\
234 print "<li
>Installation directory
: <tt
>" . htmlspecialchars( $conf->IP ) . "</tt
></li
>\n";
236 # $conf->ScriptPath = "/~brion
/inplace
";
237 $conf->ScriptPath = preg_replace( '{^(.*)/config.*$}', '$1', $_SERVER["REQUEST_URI
"] );
238 print "<li
>Script URI path
: <tt
>" . htmlspecialchars( $conf->ScriptPath ) . "</tt
></li
>\n";
240 $conf->posted = ($_SERVER["REQUEST_METHOD
"] == "POST
");
242 $conf->Sitename = ucfirst( importPost( "Sitename
", "" ) );
243 $conf->EmergencyContact = importPost( "EmergencyContact
", $_SERVER["SERVER_ADMIN
"] );
244 $conf->DBserver = importPost( "DBserver
", "localhost
" );
245 $conf->DBname = importPost( "DBname
", "wikidb
" );
246 $conf->DBuser = importPost( "DBuser
", "wikiuser
" );
247 $conf->DBpassword = importPost( "DBpassword
" );
248 $conf->DBpassword2 = importPost( "DBpassword2
" );
249 $conf->RootPW = importPost( "RootPW
" );
250 $conf->LanguageCode = importPost( "LanguageCode
", "en
-utf8
" );
251 $conf->SysopName = importPost( "SysopName
", "WikiSysop
" );
252 $conf->SysopPass = importPost( "SysopPass
" );
253 $conf->SysopPass2 = importPost( "SysopPass2
" );
255 /* Check for validity */
258 if( $conf->Sitename == "" || $conf->Sitename == "MediaWiki
" || $conf->Sitename == "Mediawiki
" ) {
259 $errs["Sitename
"] = "Must not be blank
or \"MediaWiki\"
.";
261 if( $conf->DBpassword == "" ) {
262 $errs["DBpassword
"] = "Must not be blank
";
264 if( $conf->DBpassword != $conf->DBpassword2 ) {
265 $errs["DBpassword2
"] = "Passwords don
't match!";
268 if( $conf->SysopPass == "" ) {
269 $errs["SysopPass"] = "Must not be blank";
271 if( $conf->SysopPass != $conf->SysopPass2 ) {
272 $errs["SysopPass2"] = "Passwords don't match
!";
275 $conf->License = importPost( "License
", "none
" );
276 if( $conf->License == "gfdl
" ) {
277 $conf->RightsUrl = "http
://www.gnu.org/copyleft/fdl.html";
278 $conf->RightsText
= "GNU Free Documentation License 1.2";
279 $conf->RightsCode
= "gfdl";
280 $conf->RightsIcon
= "{$conf->ScriptPath}/images/gnu-fdl.png";
281 } elseif( $conf->License
== "none" ) {
282 $conf->RightsUrl
= $conf->RightsText
= $conf->RightsCode
= $conf->RightsIcon
= "";
284 $conf->RightsUrl
= importPost( "RightsUrl", "" );
285 $conf->RightsText
= importPost( "RightsText", "" );
286 $conf->RightsCode
= importPost( "RightsCode", "" );
287 $conf->RightsIcon
= importPost( "RightsIcon", "" );
290 if( $conf->posted
&& ( 0 == count( $errs ) ) ) {
291 do { /* So we can 'continue' to end prematurely */
292 $conf->Root
= ($conf->RootPW
!= "");
294 /* Load up the settings and get installin' */
295 $local = writeLocalSettings( $conf );
296 $wgCommandLineMode = false;
299 $wgDBadminuser = $wgDBuser;
300 $wgDBadminpassword = $wgDBpassword;
301 $wgCommandLineMode = true;
302 $wgUseDatabaseMessages = false; /* FIXME: For database failure */
303 include_once( "Setup.php" );
304 include_once( "../maintenance/InitialiseMessages.inc" );
306 $wgTitle = Title
::newFromText( "Installation script" );
307 $wgDatabase = Database
::newFromParams( $wgDBserver, "root", $conf->RootPW
, "", 1 );
308 $wgDatabase->mIgnoreErrors
= true;
310 @$myver = mysql_get_server_info( $wgDatabase->mConn
);
312 print "<li>MySQL error " . ($err = mysql_errno() ) .
313 ": " . htmlspecialchars( mysql_error() );
318 $errs["RootPW"] = "Check password";
320 print "<li>Trying regular user...\n";
321 /* Try the regular user... */
322 $wgDatabase = Database
::newFromParams( $wgDBserver, $wgDBuser, $wgDBpassword, "", 1 );
323 $wgDatabase->isOpen();
324 $wgDatabase->mIgnoreErrors
= true;
325 @$myver = mysql_get_server_info( $wgDatabase->mConn
);
327 $errs["DBuser"] = "Check name/pass";
328 $errs["DBpassword"] = "or enter root";
329 $errs["DBpassword2"] = "password below";
330 $errs["RootPW"] = "Got root?";
331 print " need password.</li>\n";
343 $errs["DBserver"] = "Connection failed";
346 $errs["DBserver"] = "Couldn't connect to database";
352 if ( !$wgDatabase->isOpen() ) {
353 $errs["DBserver"] = "Couldn't connect to database";
357 print "<li>Connected to database... $myver";
358 if( version_compare( $myver, "4.0.0" ) >= 0 ) {
359 print "; enabling MySQL 4 enhancements";
360 $conf->DBmysql4
= true;
361 $local = writeLocalSettings( $conf );
365 @$sel = mysql_select_db( $wgDBname, $wgDatabase->mConn
);
367 print "<li>Database <tt>" . htmlspecialchars( $wgDBname ) . "</tt> exists</li>\n";
369 $res = $wgDatabase->query( "CREATE DATABASE `$wgDBname`" );
371 print "<li>Couldn't create database <tt>" .
372 htmlspecialchars( $wgDBname ) .
373 "</tt>; try with root access or check your username/pass.</li>\n";
374 $errs["RootPW"] = "<- Enter";
377 print "<li>Created database <tt>" . htmlspecialchars( $wgDBname ) . "</tt></li>\n";
380 $wgDatabase->selectDB( $wgDBname );
382 if( $wgDatabase->tableExists( "cur" ) ) {
383 print "<li>There are already MediaWiki tables in this database. Checking if updates are needed...</li>\n<pre>";
387 do_ipblocks_update(); flush();
388 do_interwiki_update(); flush();
389 do_index_update(); flush();
390 do_linkscc_update(); flush();
391 do_hitcounter_update(); flush();
392 do_recentchanges_update(); flush();
393 initialiseMessages(); flush();
397 print "<li>Finished update checks.</li>\n";
399 # FIXME: Check for errors
400 print "<li>Creating tables...";
401 dbsource( "../maintenance/tables.sql", $wgDatabase );
402 dbsource( "../maintenance/interwiki.sql", $wgDatabase );
403 dbsource( "../maintenance/indexes.sql", $wgDatabase );
404 print " done.</li>\n";
406 print "<li>Initializing data...";
407 $wgDatabase->query( "INSERT INTO site_stats (ss_row_id,ss_total_views," .
408 "ss_total_edits,ss_good_articles) VALUES (1,0,0,0)" );
410 if( $conf->SysopName
) {
411 $u = User
::newFromName( $conf->getSysopName() );
412 if ( 0 == $u->idForName() ) {
414 $u->setPassword( $conf->getSysopPass() );
415 $u->addRight( "sysop" );
416 $u->addRight( "bureaucrat" );
418 print "<li>Created sysop account <tt>" .
419 htmlspecialchars( $conf->SysopName
) . "</tt>.</li>\n";
421 print "<li>Could not create user - already exists!</li>\n";
424 print "<li>Skipped sysop account creation, no name given.</li>\n";
427 print "<li>Initialising log pages...";
429 "uploadlogpage" => "uploadlogpagetext",
430 "dellogpage" => "dellogpagetext",
431 "protectlogpage" => "protectlogtext",
432 "blocklogpage" => "blocklogtext"
434 $metaNamespace = Namespace::getWikipedia();
435 $now = wfTimestampNow();
436 $won = wfInvertTimestamp( $now );
437 foreach( $logs as $page => $text ) {
438 $logTitle = wfStrencode( $wgLang->ucfirst( str_replace( " ", "_", wfMsgNoDB( $page ) ) ) );
439 $logText = wfStrencode( wfMsgNoDB( $text ) );
440 $wgDatabase->query( "INSERT INTO cur (cur_namespace,cur_title,cur_text," .
441 "cur_restrictions,cur_timestamp,inverse_timestamp,cur_touched) " .
442 "VALUES ($metaNamespace,'$logTitle','$logText','sysop','$now','$won','$now')" );
446 $titleobj = Title
::newFromText( wfMsgNoDB( "mainpage" ) );
447 $title = $titleobj->getDBkey();
448 $sql = "INSERT INTO cur (cur_namespace,cur_title,cur_text,cur_timestamp,inverse_timestamp,cur_touched) " .
449 "VALUES (0,'$title','" .
450 wfStrencode( wfMsg( "mainpagetext" ) ) . "','$now','$won','$now')";
451 $wgDatabase->query( $sql, $fname );
454 initialiseMessages();
455 print "</pre></li>\n";
458 # Grant user permissions
459 dbsource( "../maintenance/users.sql", $wgDatabase );
463 /* Write out the config file now that all is well */
464 print "<p>Creating LocalSettings.php...</p>\n\n";
465 $localSettings = "<" . "?php$endl$local$endl?" . ">";
467 if( version_compare( phpversion(), "4.3.2" ) >= 0 ) {
468 $xt = "xt"; # Refuse to overwrite an existing file
470 $xt = "wt"; # 'x' is not available prior to PHP 4.3.2. We did check above, but race conditions blah blah
472 $f = fopen( "LocalSettings.php", $xt );
475 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" .
476 "<p>Here's the file that would have been written, try to paste it into place manually:</p>\n" .
477 "<pre>\n" . htmlspecialchars( $localSettings ) . "</pre>\n" );
479 fwrite( $f, $localSettings );
482 print "<p>Success! Move the LocalSettings.php file into the parent directory, then follow
483 <a href='{$conf->ScriptPath}/index.php'>this link</a> to your wiki.</p>\n";
493 if( count( $errs ) ) {
494 /* Display options form */
496 if( $conf->posted
) {
497 echo "<p class='error'>Something's not quite right yet; make sure everything below is filled out correctly.</p>\n";
501 <form name
="config" method
="post">
509 aField( $conf, "Sitename", "Site name:" );
513 Your site name should be a relatively short word
. It
'll appear as the namespace
514 name for 'meta
' pages as well as throughout the user interface. Good site names
515 are things like "<a href="http://www.wikipedia.org/">Wikipedia</a>" and
516 "<a href="http://openfacts.berlios.de/">OpenFacts</a>"; avoid punctuation,
517 which may cause problems.
522 aField( $conf, "EmergencyContact", "Contact e-mail" );
526 This will be used as the return address for password reminders and
527 may be displayed in some error conditions so visitors can get in
532 <label class='column
' for="LanguageCode">Language</label>
533 <select id="LanguageCode" name="LanguageCode">
535 $list = getLanguageList();
536 foreach( $list as $code => $name ) {
537 $sel = ($code == $conf->LanguageCode) ? "selected" : "";
538 echo "\t\t<option value=\"$code\" $sel>$name</option>\n";
544 You may select the language for the user interface of the wiki...
545 Some localizations are less complete than others. This also controls
546 the character encoding; Unicode is more flexible, but Latin-1 may be
547 more compatible with older browsers for some languages. Unicode will
548 be used where not specified otherwise.
552 <label class='column
'>Copyright/license metadata</label>
553 <div>Select one:</div>
556 <li><?php aField( $conf, "License", "no license metadata", "radio", "none" ); ?></li>
557 <li><?php aField( $conf, "License", "GNU Free Documentation License 1.2 (Wikipedia-compatible)", "radio", "gfdl" ); ?></li>
559 aField( $conf, "License", "a Creative Commons license...", "radio", "cc" );
560 $partner = "MediaWiki";
561 $exit = urlencode( "$wgServer{$conf->ScriptPath}/config/index.php?License=cc&RightsUrl=[license_url]&RightsText=[license_name]&RightsCode=[license_code]&RightsIcon=[license_button]" );
562 $icon = urlencode( "$wgServer$wgUploadPath/wiki.png" );
563 $ccApp = htmlspecialchars( "http://creativecommons.org/license/?partner=$partner&exit_url=$exit&partner_icon_url=$icon" );
564 print "<a href=\"$ccApp\">choose</a>";
566 <li><?php aField( $conf, "RightsUrl", $conf->RightsUrl, "hidden" ); ?></li>
567 <li><?php aField( $conf, "RightsText", $conf->RightsText, "hidden" ); ?></li>
568 <li><?php aField( $conf, "RightsCode", $conf->RightsCode, "hidden" ); ?></li>
569 <li><?php aField( $conf, "RightsIcon", $conf->RightsIcon, "hidden" ); ?></li>
573 MediaWiki can include a basic license notice, icon, and machine-reable
574 copyright metadata if your wiki's content is to be licensed under
575 the GNU FDL
or a Creative Commons license
. If you
're not sure, leave
581 <?php aField( $conf, "SysopName", "Sysop account name:", "" ) ?>
584 <?php aField( $conf, "SysopPass", "password:", "password" ) ?>
587 <?php aField( $conf, "SysopPass2", "again:", "password" ) ?>
590 A sysop user account can lock or delete pages, block problematic IP
591 addresses from editing, and other maintenance tasks. If creating a new
592 wiki database, a sysop account will be created with the given name
597 <h2>Database config</h2>
601 aField( $conf, "DBserver", "MySQL server" );
604 If your database server isn't on your web server
, enter the name
609 aField( $conf, "DBname", "Database name" );
612 aField( $conf, "DBuser", "DB username" );
615 aField( $conf, "DBpassword", "DB password", "password" );
618 aField( $conf, "DBpassword2", "again", "password" );
621 If you only have a single user account
and database available
,
622 enter those here
. If you have database root
access (see below
)
623 you can specify
new accounts
/databases to be created
.
629 aField( $conf, "RootPW", "DB root password", "password" );
633 You will only need this
if the database
and/or user account
634 above don
't already exist.
635 Do <em>not</em> type in your machine's root password
! MySQL
636 has its own
"root" user with a separate password
. (It might
637 even be blank
, depending on your configuration
.)
641 <label
class='column'> 
;</label
>
642 <input type
="submit" value
="Install!" />
652 /* -------------------------------------------------------------------------------------- */
654 function writeAdminSettings( $conf ) {
656 \$wgDBadminuser = \"{$conf->DBadminuser}\";
657 \$wgDBadminpassword = \"{$conf->DBadminpassword}\";
661 function writeLocalSettings( $conf ) {
662 $conf->DBmysql4
= @$conf->DBmysql4 ?
'true' : 'false';
663 $conf->UseImageResize
= $conf->UseImageResize ?
'true' : 'false';
664 $conf->PasswordSender
= $conf->EmergencyContact
;
665 if( $conf->LanguageCode
== "en-utf8" ) {
666 $conf->LanguageCode
= "en";
667 $conf->Encoding
= "UTF-8";
669 $zlib = ($conf->zlib ?
"" : "# ");
670 $magic = ($conf->ImageMagick ?
"" : "# ");
671 $convert = ($conf->ImageMagick ?
$conf->ImageMagick
: "/usr/bin/convert" );
672 $pretty = ($conf->prettyURLs ?
"" : "# ");
673 $ugly = ($conf->prettyURLs ?
"# " : "");
674 $rights = ($conf->RightsUrl
) ?
"" : "# ";
676 # $proxyKey = Parser::getRandomString() . Parser::getRandomString();
678 $sep = (DIRECTORY_SEPARATOR
== "\\") ?
";" : ":";
680 # This file was automatically generated by the MediaWiki installer.
681 # If you make manual changes, please keep track in case you need to
682 # recreate them later.
684 \$IP = \"{$conf->IP}\";
685 ini_set( \"include_path\", \"\$IP/includes$sep\$IP/languages$sep\" . ini_get(\"include_path\") );
686 include_once( \"DefaultSettings.php\" );
688 if ( \$wgCommandLineMode ) {
689 if ( isset( \$_SERVER ) && array_key_exists( 'REQUEST_METHOD', \$_SERVER ) ) {
690 die( \"This script must be run from the command line\\n\" );
693 ## Compress output if the browser supports it
694 {$zlib}if( !ini_get( 'zlib.output_compression' ) ) ob_start( 'ob_gzhandler' );
697 \$wgSitename = \"{$conf->Sitename}\";
699 \$wgScriptPath = \"{$conf->ScriptPath}\";
700 \$wgScript = \"\$wgScriptPath/index.php\";
701 \$wgRedirectScript = \"\$wgScriptPath/redirect.php\";
703 ## If using PHP as a CGI module, use the ugly URLs
704 {$pretty}\$wgArticlePath = \"\$wgScript/\$1\";
705 {$ugly}\$wgArticlePath = \"\$wgScript?title=\$1\";
707 \$wgStylePath = \"\$wgScriptPath/stylesheets\";
708 \$wgStyleSheetDirectory = \"\$IP/stylesheets\";
710 \$wgUploadPath = \"\$wgScriptPath/images\";
711 \$wgUploadDirectory = \"\$IP/images\";
712 \$wgLogo = \"\$wgUploadPath/wiki.png\";
714 \$wgEmergencyContact = \"{$conf->EmergencyContact}\";
715 \$wgPasswordSender = \"{$conf->PasswordSender}\";
717 \$wgDBserver = \"{$conf->DBserver}\";
718 \$wgDBname = \"{$conf->DBname}\";
719 \$wgDBuser = \"{$conf->DBuser}\";
720 \$wgDBpassword = \"{$conf->DBpassword}\";
722 ## To allow SQL queries through the wiki's Special:Askaql page,
723 ## uncomment the next lines. THIS IS VERY INSECURE. If you want
724 ## to allow semipublic read-only SQL access for your sysops,
725 ## you should define a MySQL user with limited privileges.
726 ## See MySQL docs: http://www.mysql.com/doc/en/GRANT.html
728 # \$wgAllowSysopQueries = true;
729 # \$wgDBsqluser = \"sqluser\";
730 # \$wgDBsqlpassword = \"sqlpass\";
732 \$wgDBmysql4 = \$wgEnablePersistentLC = {$conf->DBmysql4};
734 ## To enable image uploads, make sure the 'images' directory
735 ## is writable, then uncomment this:
736 # \$wgDisableUploads = false;
737 \$wgUseImageResize = {$conf->UseImageResize};
738 {$magic}\$wgUseImageMagick = true;
739 {$magic}\$wgImageMagickConvertCommand = \"{$convert}\";
741 ## If you have the appropriate support software installed
742 ## you can enable inline LaTeX equations:
744 \$wgMathPath = \"{\$wgUploadPath}/math\";
745 \$wgMathDirectory = \"{\$wgUploadDirectory}/math\";
746 \$wgTmpDirectory = \"{\$wgUploadDirectory}/tmp\";
748 \$wgUsePHPTal = true;
749 if ( \$wgUsePHPTal ) {
750 ini_set( \"include_path\", \"\$IP/PHPTAL-NP-0.7.0/libs$sep\" . ini_get(\"include_path\") );
753 \$wgLocalInterwiki = \$wgSitename;
755 \$wgLanguageCode = \"{$conf->LanguageCode}\";
756 " . ($conf->Encoding ?
"\$wgInputEncoding = \$wgOutputEncoding = \"{$conf->Encoding}\";" : "" ) . "
758 #\$wgProxyKey = $proxyKey;
760 ## For attaching licensing metadata to pages, and displaying an
761 ## appropriate copyright notice / icon. GNU Free Documentation
762 ## License and Creative Commons licenses are supported so far.
763 {$rights}\$wgEnableCreativeCommonsRdf = true;
764 \$wgRightsPage = \"\"; # Set to the title of a wiki page that describes your license/copyright
765 \$wgRightsUrl = \"{$conf->RightsUrl}\";
766 \$wgRightsText = \"{$conf->RightsText}\";
767 \$wgRightsIcon = \"{$conf->RightsIcon}\";
768 # \$wgRightsCode = \"{$conf->RightsCode}\"; # Not yet used
772 function dieout( $text ) {
773 die( $text . "\n\n</body>\n</html>" );
776 function importPost( $name, $default = "" ) {
777 if( isset( $_REQUEST[$name] ) ) {
778 return $_REQUEST[$name];
784 function aField( &$conf, $field, $text, $type = "", $value = "" ) {
786 $xtype = "type=\"$type\"";
791 if(!(isset($id)) or ($id == "") ) $id = $field;
792 $nolabel = ($type == "radio") ||
($type == "hidden");
796 echo "\t\t<label class='column' for=\"$id\">$text</label>\n";
799 if( $type == "radio" && $value == $conf->$field ) {
800 $checked = "checked='checked'";
804 echo "\t\t<input $xtype name=\"$field\" id=\"$id\" $checked value=\"";
805 if( $type == "radio" ) {
806 echo htmlspecialchars( $value );
808 echo htmlspecialchars( $conf->$field );
812 echo " $text</label>\n";
816 if(isset($errs[$field])) echo "<span class='error'>" . $errs[$field] . "</span>\n";
819 function getLanguageList() {
820 global $wgLanguageNames;
821 if( !isset( $wgLanguageNames ) ) {
822 $wgLanguageCode = "xxx";
823 function wfLocalUrl( $x ) { return $x; }
824 function wfLocalUrlE( $x ) { return $x; }
825 include( "../languages/Language.php" );
829 $latin1 = array( "da", "de", "en", "es", "nl", "sv" );
831 $d = opendir( "../languages" );
832 while( false !== ($f = readdir( $d ) ) ) {
833 if( preg_match( '/Language([A-Z][a-z]+)\.php$/', $f, $m ) ) {
834 $code = strtolower( $m[1] );
835 $codes[$code] = "$code - " . $wgLanguageNames[$code];
836 if( in_array( $code, $latin1 ) ) {
837 $codes[$code] .= " - Latin-1";
841 $codes["en-utf8"] = "en - English - Unicode";