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;
57 /* margin-right: 200px; */
70 <a href
="http://www.mediawiki.org/"><img
71 src
="../images/wiki.png" width
="135" height
="135" alt
="" border
="0" /></a
>
74 <b
><a href
="http://www.mediawiki.org/">MediaWiki
</a
></b
> is
75 Copyright (C
) 2001-2004 by Magnus Manske
, Brion Vibber
, Lee Daniel Crocker
,
76 Tim Starling
, Erik M
ö
;ller
, and others
.</p
>
79 <li
><a href
="../README">Readme
</a
></li
>
80 <li
><a href
="../RELEASE-NOTES">Release notes
</a
></li
>
81 <li
><a href
="../docs/">doc
/</a
></li
>
82 <li
><a href
="http://meta.wikipedia.org/wiki/MediaWiki_User's_Guide">User
's Guide</a></li>
85 <p>This program is free software; you can redistribute it and/or modify
86 it under the terms of the GNU General Public License as published by
87 the Free Software Foundation; either version 2 of the License, or
88 (at your option) any later version.</p>
90 <p>This program is distributed in the hope that it will be useful,
91 but WITHOUT ANY WARRANTY; without even the implied warranty of
92 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
93 GNU General Public License for more details.</p>
95 <p>You should have received <a href="../COPYING">a copy of the GNU General Public License</a>
96 along with this program; if not, write to the Free Software
97 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
98 or <a href="http://www.gnu.org/copyleft/gpl.html">read it online</a></p>
103 $IP = ".."; # Just to suppress notices, not for anything useful
104 include( "../includes/DefaultSettings.php" );
107 <h1>MediaWiki <?php print $wgVersion ?> installation</h1>
112 /* Check for existing configurations and bug out! */
114 if( file_exists( "../LocalSettings.php" ) || file_exists( "../AdminSettings.php" ) ) {
115 dieout( "<h2>Wiki is configured.</h2>
117 <p>Already configured... <a href='../index
.php
'>return to the wiki</a>.</p>
119 <p>(You should probably remove this directory for added security.)</p>" );
122 if( file_exists( "./LocalSettings.php" ) || file_exists( "./AdminSettings.php" ) ) {
123 dieout( "<h2>You're configured
!</h2
>
125 <p
>Please move
<tt
>LocalSettings
.php
</tt
> to the parent directory
, then
126 <a href
='../index.php'>try out your wiki
</a
>.
127 (You should remove this config directory
for added security once you
're done.)</p>" );
130 if( !is_writable( "." ) ) {
131 dieout( "<h2>Can't write config file
, aborting
</h2
>
133 <p
>In order to configure the wiki you have to make the
<tt
>config
</tt
> subdirectory
134 writable by the web server
. Once configuration is done you
'll move the created
135 <tt>LocalSettings.php</tt> to the parent directory, and for added safety you can
136 then remove the <tt>config</tt> subdirectory entirely.</p>
138 <p>To make the directory writable on a Unix/Linux system:</p>
141 cd <i>/path/to/wiki</i>
147 include( "../install-utils.inc" );
148 include( "../maintenance/updaters.inc" );
150 function getEncoded( $data ) {
152 global $wgInputEncoding;
153 if( strcasecmp( $wgInputEncoding, "utf-8" ) == 0 ) {
156 return utf8_decode( $data ); /* to latin1 wikis */
159 function getSitename() { return $this->getEncoded( $this->Sitename ); }
160 function getSysopName() { return $this->getEncoded( $this->SysopName ); }
161 function getSysopPass() { return $this->getEncoded( $this->SysopPass ); }
167 <h2>Checking environment...</h2>
172 $conf = new ConfigData;
174 install_version_checks();
175 print "<li>PHP " . phpversion() . " ok</li>\n";
177 $sapi = php_sapi_name();
178 $conf->prettyURLs = true;
179 print "<li>PHP server API is $sapi; ";
182 print "ok, using pretty URLs (<tt>index.php/Page_Title</tt>)";
186 print "using ugly URLs (<tt>index.php?title=Page_Title</tt>)";
187 $conf->prettyURLs = false;
190 print "unknown; using pretty URLs (<tt>index.php/Page_Title</tt>), if you have trouble change this in <tt>LocalSettings.php</tt>";
194 $conf->zlib = function_exists( "gzencode" );
196 print "<li>Have zlib support; enabling output compression.</li>\n";
198 print "<li>No zlib support.</li>\n";
201 $conf->ImageMagick = false;
203 $conf->HaveGD = function_exists( "imagejpeg" );
204 if( $conf->HaveGD ) {
205 print "<li>Found GD graphics library built-in, image thumbnailing will be enabled if you enable uploads.</li>\n";
207 $imcheck = array( "/usr/bin", "/usr/local/bin", "/sw/bin" );
208 foreach( $imcheck as $dir ) {
209 $im = "$dir/convert";
210 if( file_exists( $im ) ) {
211 print "<li>Found ImageMagick: <tt>$im</tt>; image thumbnailing will be enabled if you enable uploads.</li>\n";
212 $conf->ImageMagick = $im;
216 if( !$conf->ImageMagick ) {
217 print "<li>Couldn't find GD library
or ImageMagick
; image thumbnailing disabled
.</li
>\n";
221 $conf->UseImageResize = $conf->HaveGD || $conf->ImageMagick;
223 # $conf->IP = "/Users
/brion
/Sites
/inplace
";
225 $conf->IP = getcwd();
227 print "<li
>Installation directory
: <tt
>" . htmlspecialchars( $conf->IP ) . "</tt
></li
>\n";
229 # $conf->ScriptPath = "/~brion
/inplace
";
230 $conf->ScriptPath = preg_replace( '{^(.*)/config.*$}', '$1', $_SERVER["REQUEST_URI
"] );
231 print "<li
>Script URI path
: <tt
>" . htmlspecialchars( $conf->ScriptPath ) . "</tt
></li
>\n";
233 $conf->posted = ($_SERVER["REQUEST_METHOD
"] == "POST
");
235 $conf->Sitename = ucfirst( importPost( "Sitename
", "" ) );
236 $conf->EmergencyContact = importPost( "EmergencyContact
", $_SERVER["SERVER_ADMIN
"] );
237 $conf->DBserver = importPost( "DBserver
", "localhost
" );
238 $conf->DBname = importPost( "DBname
", "wikidb
" );
239 $conf->DBuser = importPost( "DBuser
", "wikiuser
" );
240 $conf->DBpassword = importPost( "DBpassword
" );
241 $conf->DBpassword2 = importPost( "DBpassword2
" );
242 $conf->RootPW = importPost( "RootPW
" );
243 $conf->LanguageCode = importPost( "LanguageCode
", "en
-utf8
" );
244 $conf->SysopName = importPost( "SysopName
", "WikiSysop
" );
245 $conf->SysopPass = importPost( "SysopPass
" );
246 $conf->SysopPass2 = importPost( "SysopPass2
" );
248 /* Check for validity */
251 if( $conf->Sitename == "" || $conf->Sitename == "MediaWiki
" || $conf->Sitename == "Mediawiki
" ) {
252 $errs["Sitename
"] = "Must not be blank
or \"MediaWiki\"
.";
254 if( $conf->DBpassword == "" ) {
255 $errs["DBpassword
"] = "Must not be blank
";
257 if( $conf->DBpassword != $conf->DBpassword2 ) {
258 $errs["DBpassword2
"] = "Passwords don
't match!";
261 if( $conf->SysopPass == "" ) {
262 $errs["SysopPass"] = "Must not be blank";
264 if( $conf->SysopPass != $conf->SysopPass2 ) {
265 $errs["SysopPass2"] = "Passwords don't match
!";
268 if( $conf->posted && ( 0 == count( $errs ) ) ) {
269 do { /* So we can 'continue' to end prematurely */
270 $conf->Root = ($conf->RootPW != "");
272 /* Load up the settings and get installin' */
273 $local = writeLocalSettings( $conf );
274 $wgCommandLineMode = false;
277 $wgDBadminuser = $wgDBuser;
278 $wgDBadminpassword = $wgDBpassword;
279 $wgCommandLineMode = true;
280 $wgUseDatabaseMessages = false; /* FIXME: For database failure */
281 include_once( "Setup
.php
" );
282 include_once( "../maintenance
/InitialiseMessages
.inc
" );
284 $wgTitle = Title::newFromText( "Installation script
" );
285 $wgDatabase = Database::newFromParams( $wgDBserver, "root
", $conf->RootPW, "", 1 );
286 $wgDatabase->mIgnoreErrors = true;
288 @$myver = mysql_get_server_info( $wgDatabase->mConn );
290 print "<li
>MySQL error
" . ($err = mysql_errno() ) .
291 ": " . htmlspecialchars( mysql_error() );
296 $errs["RootPW
"] = "Check password
";
298 print "<li
>Trying regular user
...\n";
299 /* Try the regular user... */
300 $wgDatabase = Database::newFromParams( $wgDBserver, $wgDBuser, $wgDBpassword, "", 1 );
301 $wgDatabase->isOpen();
302 $wgDatabase->mIgnoreErrors = true;
303 @$myver = mysql_get_server_info( $wgDatabase->mConn );
305 $errs["DBuser
"] = "Check name
/pass
";
306 $errs["DBpassword
"] = "or enter root
";
307 $errs["DBpassword2
"] = "password below
";
308 $errs["RootPW
"] = "Got root?
";
309 print " need password
.</li
>\n";
321 $errs["DBserver
"] = "Connection failed
";
324 $errs["DBserver
"] = "Couldn
't connect to database";
330 if ( !$wgDatabase->isOpen() ) {
331 $errs["DBserver"] = "Couldn't connect to database
";
335 print "<li
>Connected to database
... $myver";
336 if( version_compare( $myver, "4.0.0" ) >= 0 ) {
337 print "; enabling MySQL
4 enhancements
";
338 $conf->DBmysql4 = true;
339 $local = writeLocalSettings( $conf );
343 @$sel = mysql_select_db( $wgDBname, $wgDatabase->mConn );
345 print "<li
>Database
<tt
>" . htmlspecialchars( $wgDBname ) . "</tt
> exists
</li
>\n";
347 $res = $wgDatabase->query( "CREATE DATABASE `
$wgDBname`
" );
349 print "<li
>Couldn
't create database <tt>" .
350 htmlspecialchars( $wgDBname ) .
351 "</tt>; try with root access or check your username/pass.</li>\n";
352 $errs["RootPW"] = "<- Enter";
355 print "<li>Created database <tt>" . htmlspecialchars( $wgDBname ) . "</tt></li>\n";
358 $wgDatabase->selectDB( $wgDBname );
360 if( $wgDatabase->tableExists( "cur" ) ) {
361 print "<li>There are already MediaWiki tables in this database. Checking if updates are needed...</li>\n<pre>";
365 do_ipblocks_update(); flush();
366 do_interwiki_update(); flush();
367 do_index_update(); flush();
368 do_linkscc_update(); flush();
369 do_hitcounter_update(); flush();
370 do_recentchanges_update(); flush();
371 initialiseMessages(); flush();
375 print "<li>Finished update checks.</li>\n";
377 # FIXME: Check for errors
378 print "<li>Creating tables...";
379 dbsource( "../maintenance/tables.sql", $wgDatabase );
380 dbsource( "../maintenance/interwiki.sql", $wgDatabase );
381 dbsource( "../maintenance/indexes.sql", $wgDatabase );
382 print " done.</li>\n";
384 print "<li>Initializing data...";
385 $wgDatabase->query( "INSERT INTO site_stats (ss_row_id,ss_total_views," .
386 "ss_total_edits,ss_good_articles) VALUES (1,0,0,0)" );
388 if( $conf->SysopName ) {
389 $u = User::newFromName( $conf->getSysopName() );
390 if ( 0 == $u->idForName() ) {
392 $u->setPassword( $conf->getSysopPass() );
393 $u->addRight( "sysop" );
394 $u->addRight( "bureaucrat" );
396 print "<li>Created sysop account <tt>" .
397 htmlspecialchars( $conf->SysopName ) . "</tt>.</li>\n";
399 print "<li>Could not create user - already exists!</li>\n";
402 print "<li>Skipped sysop account creation, no name given.</li>\n";
405 print "<li>Initialising log pages...";
407 "uploadlogpage" => "uploadlogpagetext",
408 "dellogpage" => "dellogpagetext",
409 "protectlogpage" => "protectlogtext",
410 "blocklogpage" => "blocklogtext"
412 $metaNamespace = Namespace::getWikipedia();
413 $now = wfTimestampNow();
414 $won = wfInvertTimestamp( $now );
415 foreach( $logs as $page => $text ) {
416 $logTitle = wfStrencode( $wgLang->ucfirst( str_replace( " ", "_", wfMsgNoDB( $page ) ) ) );
417 $logText = wfStrencode( wfMsgNoDB( $text ) );
418 $wgDatabase->query( "INSERT INTO cur (cur_namespace,cur_title,cur_text," .
419 "cur_restrictions,cur_timestamp,inverse_timestamp,cur_touched) " .
420 "VALUES ($metaNamespace,'$logTitle','$logText','sysop
','$now','$won','$now')" );
424 $titleobj = Title::newFromText( wfMsgNoDB( "mainpage" ) );
425 $title = $titleobj->getDBkey();
426 $sql = "INSERT INTO cur (cur_namespace,cur_title,cur_text,cur_timestamp,inverse_timestamp,cur_touched) " .
427 "VALUES (0,'$title','" .
428 wfStrencode( wfMsg( "mainpagetext
" ) ) . "','$now','$won','$now')";
429 $wgDatabase->query( $sql, $fname );
432 initialiseMessages();
433 print "</pre></li>\n";
436 # Grant user permissions
437 dbsource( "../maintenance/users.sql", $wgDatabase );
441 /* Write out the config file now that all is well */
442 print "<p>Creating LocalSettings.php...</p>\n\n";
443 $localSettings = "<" . "?php$endl$local$endl?" . ">";
445 if( version_compare( phpversion(), "4.3.2" ) >= 0 ) {
446 $xt = "xt"; # Refuse to overwrite an existing file
448 $xt = "wt"; # 'x
' is not available prior to PHP 4.3.2. We did check above, but race conditions blah blah
450 $f = fopen( "LocalSettings.php", $xt );
453 dieout( "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" .
454 "<p>Here's the file that would have been written
, try to paste it into place manually
:</p
>\n" .
455 "<pre
>\n" . htmlspecialchars( $localSettings ) . "</pre
>\n" );
457 fwrite( $f, $localSettings );
460 print "<p
>Success
! Move the LocalSettings
.php file into the parent directory
, then follow
461 <a href
='{$conf->ScriptPath}/index.php'>this link
</a
> to your wiki
.</p
>\n";
471 if( count( $errs ) ) {
472 /* Display options form */
474 if( $conf->posted ) {
475 echo "<p
class='error'>Something
's not quite right yet; make sure everything below is filled out correctly.</p>\n";
479 <form name="config" method="post">
487 aField( $conf, "Sitename", "Site name:" );
491 Your site name should be a relatively short word. It'll appear
as the
namespace
492 name
for 'meta' pages
as well
as throughout the user
interface. Good site names
493 are things like
"<a href="http
://www.wikipedia.org/">Wikipedia</a>" and
494 "<a href="http
://openfacts.berlios.de/">OpenFacts</a>"; avoid punctuation,
495 which may cause problems
.
500 aField( $conf, "EmergencyContact", "Contact e-mail" );
504 This will be used
as the
return address
for password reminders
and
505 may be displayed in some error conditions so visitors can get in
510 <label
for="LanguageCode">Language
</label
>
511 <select id
="LanguageCode" name
="LanguageCode">
513 $list = getLanguageList();
514 foreach( $list as $code => $name ) {
515 $sel = ($code == $conf->LanguageCode
) ?
"selected" : "";
516 echo "\t\t<option value=\"$code\" $sel>$name</option>\n";
522 You may select the language
for the user
interface of the wiki
...
523 Some localizations are less complete than others
. This also controls
524 the character encoding
; Unicode is more flexible
, but Latin
-1 may be
525 more compatible with older browsers
for some languages
. Unicode will
526 be used where not specified otherwise
.
530 <?php
aField( $conf, "SysopName", "Sysop account name:", "" ) ?
>
533 <?php
aField( $conf, "SysopPass", "password:", "password" ) ?
>
536 <?php
aField( $conf, "SysopPass2", "again:", "password" ) ?
>
539 A sysop user account can lock
or delete pages
, block problematic IP
540 addresses from editing
, and other maintenance tasks
. If creating a
new
541 wiki database
, a sysop account will be created with the given name
546 <h2
>Database config
</h2
>
550 aField( $conf, "DBserver", "MySQL server" );
553 If your database server isn
't on your web server, enter the name
558 aField( $conf, "DBname", "Database name" );
561 aField( $conf, "DBuser", "DB username" );
564 aField( $conf, "DBpassword", "DB password", "password" );
567 aField( $conf, "DBpassword2", "again", "password" );
570 If you only have a single user account and database available,
571 enter those here. If you have database root access (see below)
572 you can specify new accounts/databases to be created.
578 aField( $conf, "RootPW", "DB root password", "password" );
582 You will only need this if the database and/or user account
583 above don't already exist
.
584 Do <em
>not
</em
> type in your machine
's root password! MySQL
585 has its own "root" user with a separate password. (It might
586 even be blank, depending on your configuration.)
590 <label> </label>
591 <input type="submit" value="Install!" />
601 /* -------------------------------------------------------------------------------------- */
603 function writeAdminSettings( $conf ) {
605 \$wgDBadminuser = \"{$conf->DBadminuser}\";
606 \$wgDBadminpassword = \"{$conf->DBadminpassword}\";
610 function writeLocalSettings( $conf ) {
611 $conf->DBmysql4 = @$conf->DBmysql4 ? 'true' : 'false';
612 $conf->UseImageResize = $conf->UseImageResize ? 'true' : 'false';
613 $conf->PasswordSender = $conf->EmergencyContact;
614 if( $conf->LanguageCode == "en-utf8" ) {
615 $conf->LanguageCode = "en";
616 $conf->Encoding = "UTF-8";
618 $zlib = ($conf->zlib ? "" : "# ");
619 $magic = ($conf->ImageMagick ? "" : "# ");
620 $convert = ($conf->ImageMagick ? $conf->ImageMagick : "/usr/bin/convert" );
621 $pretty = ($conf->prettyURLs ? "" : "# ");
622 $ugly = ($conf->prettyURLs ? "# " : "");
624 $sep = (DIRECTORY_SEPARATOR == "\\") ? ";" : ":";
626 # This file was automatically generated by the MediaWiki installer.
627 # If you make manual changes, please keep track in case you need to
628 # recreate them later.
630 \$IP = \"{$conf->IP}\";
631 ini_set( \"include_path\", \"\$IP/includes$sep\$IP/languages$sep\" . ini_get(\"include_path\") );
632 include_once( \"DefaultSettings.php\" );
634 if( \$wgCommandLineMode ) {
635 die( \"Can't
use command
-line utils with in
-place install yet
, sorry
.\" );
637 ## Compress output if the browser supports it
638 {$zlib}if( !ini_get( 'zlib.output_compression' ) ) ob_start( 'ob_gzhandler' );
641 \
$wgSitename = \"{$conf->Sitename
}\";
643 \
$wgScriptPath = \"{$conf->ScriptPath
}\";
644 \
$wgScript = \"\
$wgScriptPath/index
.php\"
;
645 \
$wgRedirectScript = \"\
$wgScriptPath/redirect
.php\"
;
647 ## If using PHP as a CGI module, use the ugly URLs
648 {$pretty}\
$wgArticlePath = \"\
$wgScript/\
$1\";
649 {$ugly}\
$wgArticlePath = \"\
$wgScript?title
=\
$1\";
651 \
$wgStyleSheetPath = \"\
$wgScriptPath/stylesheets\"
;
652 \
$wgStyleSheetDirectory = \"\
$IP/stylesheets\"
;
654 \
$wgUploadPath = \"\
$wgScriptPath/images\"
;
655 \
$wgUploadDirectory = \"\
$IP/images\"
;
656 \
$wgLogo = \"\
$wgUploadPath/wiki
.png\"
;
658 \
$wgEmergencyContact = \"{$conf->EmergencyContact
}\";
659 \
$wgPasswordSender = \"{$conf->PasswordSender
}\";
661 \
$wgDBserver = \"{$conf->DBserver
}\";
662 \
$wgDBname = \"{$conf->DBname
}\";
663 \
$wgDBuser = \"{$conf->DBuser
}\";
664 \
$wgDBpassword = \"{$conf->DBpassword
}\";
666 ## To allow SQL queries through the wiki's Special:Askaql page,
667 ## uncomment the next lines. THIS IS VERY INSECURE. If you want
668 ## to allow semipublic read-only SQL access for your sysops,
669 ## you should define a MySQL user with limited privileges.
670 ## See MySQL docs: http://www.mysql.com/doc/en/GRANT.html
672 # \$wgAllowSysopQueries = true;
673 # \$wgDBsqluser = \"sqluser\";
674 # \$wgDBsqlpassword = \"sqlpass\";
676 \
$wgDBmysql4 = \
$wgEnablePersistentLC = {$conf->DBmysql4
};
678 ## To enable image uploads, make sure the 'images' directory
679 ## is writable, then uncomment this:
680 # \$wgDisableUploads = false;
681 \
$wgUseImageResize = {$conf->UseImageResize
};
682 {$magic}\
$wgUseImageMagick = true;
683 {$magic}\
$wgImageMagickConvertCommand = \"{$convert}\";
685 ## If you have the appropriate support software installed
686 ## you can enable inline LaTeX equations:
688 \
$wgMathPath = \"{\
$wgUploadPath}/math\"
;
689 \
$wgMathDirectory = \"{\
$wgUploadDirectory}/math\"
;
690 \
$wgTmpDirectory = \"{\
$wgUploadDirectory}/tmp\"
;
692 ## Experimental layout template subsystems
693 \
$wgUsePHPTal = false;
694 \
$wgUseSmarty = false;
695 if ( \
$wgUsePHPTal ) {
696 ini_set( \"include_path\"
, \"\
$IP/PHPTAL
-NP
-0.7.0/libs
$sep\" . ini_get(\"include_path\"
) );
698 if ( \
$wgUseSmarty ) {
699 ini_set( \"include_path\"
, \"\
$IP/Smarty
-2.6.2/libs
$sep\" . ini_get(\"include_path\"
) );
702 \
$wgLocalInterwiki = \
$wgSitename;
704 \
$wgLanguageCode = \"{$conf->LanguageCode
}\";
705 " . ($conf->Encoding ? "\
$wgInputEncoding = \
$wgOutputEncoding = \"{$conf->Encoding
}\";" : "" ) . "
710 function dieout( $text ) {
711 die( $text . "\n\n
</body
>\n</html
>" );
714 function importPost( $name, $default = "" ) {
715 if( isset( $_POST[$name] ) ) {
716 return $_POST[$name];
722 function aField( &$conf, $field, $text, $type = "" ) {
723 if( $type != "" ) $type = "type
=\"$type\"";
724 echo "\t\t
<label
for=\"$field\">$text</label
>\n";
725 echo "\t\t
<input
$type name
=\"$field\" id
=\"$field\" value
=\"";
726 echo htmlspecialchars( $conf->$field );
730 if(isset($errs[$field])) echo "<span
class='error'>" . $errs[$field] . "</span
>\n";
733 function getLanguageList() {
734 global $wgLanguageNames;
735 if( !isset( $wgLanguageNames ) ) {
736 $wgLanguageCode = "xxx
";
737 function wfLocalUrl( $x ) { return $x; }
738 function wfLocalUrlE( $x ) { return $x; }
739 include( "../languages
/Language
.php
" );
743 $latin1 = array( "da
", "de
", "en
", "es
", "nl
", "sv
" );
745 $d = opendir( "../languages
" );
746 while( false !== ($f = readdir( $d ) ) ) {
747 if( preg_match( '/Language([A-Z][a-z]+)\.php$/', $f, $m ) ) {
748 $code = strtolower( $m[1] );
749 $codes[$code] = "$code - " . $wgLanguageNames[$code];
750 if( in_array( $code, $latin1 ) ) {
751 $codes[$code] .= " - Latin
-1";
755 $codes["en
-utf8
"] = "en
- English
- Unicode
";