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 progarm 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>
102 include( "../includes/DefaultSettings.php" );
105 <h1>MediaWiki <?php print $wgVersion ?> installation</h1>
110 /* Check for existing configurations and bug out! */
112 if( file_exists( "../LocalSettings.php" ) || file_exists( "../AdminSettings.php" ) ) {
113 dieout( "<h2>Wiki is configured.</h2>
115 <p>Already configured... <a href='../index
.php
'>return to the wiki</a>.</p>
117 <p>(You should probably remove this directory for added security.)</p>" );
120 if( file_exists( "./LocalSettings.php" ) || file_exists( "./AdminSettings.php" ) ) {
121 dieout( "<h2>You're configured
!</h2
>
123 <p
>Please move
<tt
>LocalSettings
.php
</tt
> to the parent directory
, then
124 <a href
='../index.php'>try out your wiki
</a
>.
125 (You should remove this config directory
for added security once you
're done.)</p>" );
128 if( !is_writable( "." ) ) {
129 dieout( "<h2>Can't write config file
, aborting
</h2
>
131 <p
>In order to configure the wiki you have to make the
<tt
>config
</tt
> subdirectory
132 writable by the web server
. Once configuration is done you
'll move the created
133 <tt>LocalSettings.php</tt> to the parent directory, and for added safety you can
134 then remove the <tt>config</tt> subdirectory entirely.</p>
136 <p>To make the directory writable on a Unix/Linux system:</p>
139 cd <i>/path/to/wiki</i>
145 include( "../install-utils.inc" );
146 include( "../maintenance/updaters.inc" );
148 function getEncoded( $data ) {
150 global $wgInputEncoding;
151 if( strcasecmp( $wgInputEncoding, "utf-8" ) == 0 ) {
154 return utf8_decode( $data ); /* to latin1 wikis */
157 function getSitename() { return $this->getEncoded( $this->Sitename ); }
158 function getSysopName() { return $this->getEncoded( $this->SysopName ); }
159 function getSysopPass() { return $this->getEncoded( $this->SysopPass ); }
165 <h2>Checking environment...</h2>
169 $conf = new ConfigData;
171 install_version_checks();
172 print "<li>PHP " . phpversion() . " ok</li>\n";
174 $sapi = php_sapi_name();
175 $conf->prettyURLs = true;
176 print "<li>PHP server API is $sapi; ";
179 print "ok, using pretty URLs (<tt>index.php/Page_Title</tt>)";
183 print "using ugly URLs (<tt>index.php?title=Page_Title</tt>)";
184 $conf->prettyURLs = false;
187 print "unknown; using pretty URLs (<tt>index.php/Page_Title</tt>), if you have trouble change this in <tt>LocalSettings.php</tt>";
191 $conf->zlib = function_exists( "gzencode" );
193 print "<li>Have zlib support; enabling output compression.</li>\n";
195 print "<li>No zlib support.</li>\n";
198 $conf->ImageMagick = false;
200 $conf->HaveGD = function_exists( "imagejpeg" );
201 if( $conf->HaveGD ) {
202 print "<li>Found GD graphics library built-in, image thumbnailing will be enabled if you enable uploads.</li>\n";
204 $imcheck = array( "/usr/bin", "/usr/local/bin", "/sw/bin" );
205 foreach( $imcheck as $dir ) {
206 $im = "$dir/convert";
207 if( file_exists( $im ) ) {
208 print "<li>Found ImageMagick: <tt>$im</tt>; image thumbnailing will be enabled if you enable uploads.</li>\n";
209 $conf->ImageMagick = $im;
213 if( !$conf->ImageMagick ) {
214 print "<li>Couldn't find GD library
or ImageMagick
; image thumbnailing disabled
.</li
>\n";
218 $conf->UseImageResize = $conf->HaveGD || $conf->ImageMagick;
220 # $conf->IP = "/Users
/brion
/Sites
/inplace
";
222 $conf->IP = getcwd();
224 print "<li
>Installation directory
: <tt
>" . htmlspecialchars( $conf->IP ) . "</tt
></li
>\n";
226 # $conf->ScriptPath = "/~brion
/inplace
";
227 $conf->ScriptPath = preg_replace( '{^(.*)/config.*$}', '$1', $_SERVER["REQUEST_URI
"] );
228 print "<li
>Script URI path
: <tt
>" . htmlspecialchars( $conf->ScriptPath ) . "</tt
></li
>\n";
230 $conf->posted = ($_SERVER["REQUEST_METHOD
"] == "POST
");
232 $conf->Sitename = ucfirst( importPost( "Sitename
", "" ) );
233 $conf->EmergencyContact = importPost( "EmergencyContact
", $_SERVER["SERVER_ADMIN
"] );
234 $conf->DBserver = importPost( "DBserver
", "localhost
" );
235 $conf->DBname = importPost( "DBname
", "wikidb
" );
236 $conf->DBuser = importPost( "DBuser
", "wikiuser
" );
237 $conf->DBpassword = importPost( "DBpassword
" );
238 $conf->DBpassword2 = importPost( "DBpassword2
" );
239 $conf->RootPW = importPost( "RootPW
" );
240 $conf->LanguageCode = importPost( "LanguageCode
", "en
-utf8
" );
241 $conf->SysopName = importPost( "SysopName
", "WikiSysop
" );
242 $conf->SysopPass = importPost( "SysopPass
" );
243 $conf->SysopPass2 = importPost( "SysopPass2
" );
245 /* Check for validity */
248 if( $conf->Sitename == "" || $conf->Sitename == "MediaWiki
" || $conf->Sitename == "Mediawiki
" ) {
249 $errs["Sitename
"] = "Must not be blank
or \"MediaWiki\"
.";
251 if( $conf->DBpassword == "" ) {
252 $errs["DBpassword
"] = "Must not be blank
";
254 if( $conf->DBpassword != $conf->DBpassword2 ) {
255 $errs["DBpassword2
"] = "Passwords don
't match!";
258 if( $conf->SysopPass == "" ) {
259 $errs["SysopPass"] = "Must not be blank";
261 if( $conf->SysopPass != $conf->SysopPass2 ) {
262 $errs["SysopPass2"] = "Passwords don't match
!";
265 if( $conf->posted && ( 0 == count( $errs ) ) ) {
266 do { /* So we can 'continue' to end prematurely */
267 $conf->Root = ($conf->RootPW != "");
269 /* Load up the settings and get installin' */
270 $local = writeLocalSettings( $conf );
271 $wgCommandLineMode = false;
274 $wgDBadminuser = $wgDBuser;
275 $wgDBadminpassword = $wgDBpassword;
276 $wgCommandLineMode = true;
277 $wgUseDatabaseMessages = false; /* FIXME: For database failure */
278 include_once( "Setup
.php
" );
279 include_once( "../maintenance
/InitialiseMessages
.inc
" );
281 $wgTitle = Title::newFromText( "Installation script
" );
284 $wgDatabase = Database::newFromParams( $wgDBserver, "root
", $conf->RootPW, "", 1 );
286 $wgDatabase = Database::newFromParams( $wgDBserver, $wgDBuser, $wgDBpassword, "", 1 );
288 $wgDatabase->mIgnoreErrors = true;
290 if ( !$wgDatabase->isOpen() ) {
291 $errs["DBserver
"] = "Couldn
't connect to database";
295 @$myver = mysql_get_server_info( $wgDatabase->mConn );
297 print "<li>MySQL error " . ($err = mysql_errno() ) .
298 ": " . htmlspecialchars( mysql_error() );
303 $errs["RootPW"] = "Check password";
305 print "<li>Trying root...\n";
306 /* Try a blank root password... */
307 $wgDatabase = Database::newFromParams( $wgDBserver, "root", "", "", 1 );
308 $wgDatabase->isOpen();
309 $wgDatabase->mIgnoreErrors = true;
310 @$myver = mysql_get_server_info( $wgDatabase->mConn );
312 $errs["DBuser"] = "Check name/pass";
313 $errs["DBpassword"] = "or enter root";
314 $errs["DBpassword2"] = "password below";
315 $errs["RootPW"] = "Got root?";
316 print " need password.</li>\n";
328 $errs["DBserver"] = "Connection failed";
331 $errs["DBserver"] = "Couldn't connect to database
";
336 print "<li
>Connected to database
... $myver";
337 if( version_compare( $myver, "4.0.0" ) >= 0 ) {
338 print "; enabling MySQL
4 enhancements
";
339 $conf->DBmysql4 = true;
340 $local = writeLocalSettings( $conf );
344 @$sel = mysql_select_db( $wgDBname, $wgDatabase->mConn );
346 print "<li
>Database
<tt
>" . htmlspecialchars( $wgDBname ) . "</tt
> exists
</li
>\n";
348 $res = $wgDatabase->query( "CREATE DATABASE `
$wgDBname`
" );
350 print "<li
>Couldn
't create database <tt>" .
351 htmlspecialchars( $wgDBname ) .
352 "</tt>; try with root access or check your username/pass.</li>\n";
353 $errs["RootPW"] = "<- Enter";
356 print "<li>Created database <tt>" . htmlspecialchars( $wgDBname ) . "</tt></li>\n";
359 $wgDatabase->selectDB( $wgDBname );
361 if( $wgDatabase->tableExists( "cur" ) ) {
362 print "<li>There are already MediaWiki tables in this database. Checking if updates are needed...</li>\n<pre>";
366 do_ipblocks_update(); flush();
367 do_interwiki_update(); flush();
368 do_index_update(); flush();
369 do_linkscc_update(); flush();
370 do_hitcounter_update(); flush();
371 do_recentchanges_update(); flush();
372 initialiseMessages(); flush();
376 print "<li>Finished update checks.</li>\n";
378 # FIXME: Check for errors
379 print "<li>Creating tables...";
380 dbsource( "../maintenance/tables.sql", $wgDatabase );
381 dbsource( "../maintenance/interwiki.sql", $wgDatabase );
382 dbsource( "../maintenance/indexes.sql", $wgDatabase );
383 print " done.</li>\n";
385 print "<li>Initializing data...";
386 $wgDatabase->query( "INSERT INTO site_stats (ss_row_id,ss_total_views," .
387 "ss_total_edits,ss_good_articles) VALUES (1,0,0,0)" );
389 if( $conf->SysopName ) {
390 $u = User::newFromName( $conf->getSysopName() );
391 if ( 0 == $u->idForName() ) {
393 $u->setPassword( $conf->getSysopPass() );
394 $u->addRight( "sysop" );
395 $u->addRight( "bureaucrat" );
397 print "<li>Created sysop account <tt>" .
398 htmlspecialchars( $conf->SysopName ) . "</tt>.</li>\n";
400 print "<li>Could not create user - already exists!</li>\n";
403 print "<li>Skipped sysop account creation, no name given.</li>\n";
406 print "<li>Initialising log pages...";
408 "uploadlogpage" => "uploadlogpagetext",
409 "dellogpage" => "dellogpagetext",
410 "protectlogpage" => "protectlogtext",
411 "blocklogpage" => "bloglogtext"
413 $metaNamespace = Namespace::getWikipedia();
414 $now = wfTimestampNow();
415 $won = wfInvertTimestamp( $now );
416 foreach( $logs as $page => $text ) {
417 $logTitle = wfStrencode( $wgLang->ucfirst( str_replace( " ", "_", wfMsgNoDB( $page ) ) ) );
418 $logText = wfStrencode( wfMsgNoDB( $text ) );
419 $wgDatabase->query( "INSERT INTO cur (cur_namespace,cur_title,cur_text," .
420 "cur_restrictions,cur_timestamp,inverse_timestamp,cur_touched) " .
421 "VALUES ($metaNamespace,'$logTitle','$logText','sysop
','$now','$won','$now')" );
425 $titleobj = Title::newFromText( wfMsgNoDB( "mainpage" ) );
426 $title = $titleobj->getDBkey();
427 $sql = "INSERT INTO cur (cur_namespace,cur_title,cur_text,cur_timestamp,inverse_timestamp,cur_touched) " .
428 "VALUES (0,'$title','" .
429 wfStrencode( wfMsg( "mainpagetext
" ) ) . "','$now','$won','$now')";
430 $wgDatabase->query( $sql, $fname );
433 initialiseMessages();
434 print "</pre></li>\n";
437 # Grant user permissions
438 dbsource( "../maintenance/users.sql", $wgDatabase );
442 /* Write out the config file now that all is well */
443 print "<p>Creating LocalSettings.php...</p>\n\n";
444 $localSettings = "<" . "?php\n$local\n?" . ">";
446 if( version_compare( phpversion(), "4.3.2" ) >= 0 ) {
447 $xt = "xt"; # Refuse to overwrite an existing file
449 $xt = "wt"; # 'x
' is not available prior to PHP 4.3.2. We did check above, but race conditions blah blah
451 $f = fopen( "LocalSettings.php", $xt );
454 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" .
455 "<p>Here's the file that would have been written
, try to paste it into place manually
:</p
>\n" .
456 "<pre
>\n" . htmlspecialchars( $localSettings ) . "</pre
>\n" );
458 fwrite( $f, $localSettings );
461 print "<p
>Success
! Move the LocalSettings
.php file into the parent directory
, then follow
462 <a href
='{$conf->ScriptPath}/index.php'>this link
</a
> to your wiki
.</p
>\n";
472 if( count( $errs ) ) {
473 /* Display options form */
475 if( $conf->posted ) {
476 echo "<p
class='error'>Something
's not quite right yet; make sure everything below is filled out correctly.</p>\n";
480 <form name="config" method="post">
488 aField( $conf, "Sitename", "Site name:" );
492 Your site name should be a relatively short word. It'll appear
as the
namespace
493 name
for 'meta' pages
as well
as throughout the user
interface. Good site names
494 are things like
"<a href="http
://www.wikipedia.org/">Wikipedia</a>" and
495 "<a href="http
://openfacts.berlios.de/">OpenFacts</a>"; avoid punctuation,
496 which may cause problems
.
501 aField( $conf, "EmergencyContact", "Contact e-mail" );
505 This will be used
as the
return address
for password reminders
and
506 may be displayed in some error conditions so visitors can get in
511 <label
for="LanguageCode">Language
</label
>
512 <select id
="LanguageCode" name
="LanguageCode">
514 $list = getLanguageList();
515 foreach( $list as $code => $name ) {
516 $sel = ($code == $conf->LanguageCode
) ?
"selected" : "";
517 echo "\t\t<option value=\"$code\" $sel>$name</option>\n";
523 You may select the language
for the user
interface of the wiki
...
524 Some localizations are less complete than others
. This also controls
525 the character encoding
; Unicode is more flexible
, but Latin
-1 may be
526 more compatible with older browsers
for some languages
. Unicode will
527 be used where not specified otherwise
.
531 <?php
aField( $conf, "SysopName", "Sysop account name:", "" ) ?
>
534 <?php
aField( $conf, "SysopPass", "password:", "password" ) ?
>
537 <?php
aField( $conf, "SysopPass2", "again:", "password" ) ?
>
540 A sysop user account can lock
or delete pages
, block problematic IP
541 addresses from editing
, and other maintenance tasks
. If creating a
new
542 wiki database
, a sysop account will be created with the given name
547 <h2
>Database config
</h2
>
551 aField( $conf, "DBserver", "MySQL server" );
554 If your database server isn
't on your web server, enter the name
559 aField( $conf, "DBname", "Database name" );
562 aField( $conf, "DBuser", "DB username" );
565 aField( $conf, "DBpassword", "DB password", "password" );
568 aField( $conf, "DBpassword2", "again", "password" );
571 If you only have a single user account and database available,
572 enter those here. If you have database root access (see below)
573 you can specify new accounts/databases to be created.
579 aField( $conf, "RootPW", "DB root password", "password" );
583 You will only need this if the database and/or user account
584 above don't already exist
.
585 Do <em
>not
</em
> type in your machine
's root password! MySQL
586 has its own "root" user with a separate password. (It might
587 even be blank, depending on your configuration.)
591 <label> </label>
592 <input type="submit" value="Install!" />
602 /* -------------------------------------------------------------------------------------- */
604 function writeAdminSettings( $conf ) {
606 \$wgDBadminuser = \"{$conf->DBadminuser}\";
607 \$wgDBadminpassword = \"{$conf->DBadminpassword}\";
611 function writeLocalSettings( $conf ) {
612 $conf->DBmysql4 = $conf->DBmysql4 ? 'true' : 'false';
613 $conf->UseImageResize = $conf->UseImageResize ? 'true' : 'false';
614 $conf->PasswordSender = $conf->EmergencyContact;
615 if( $conf->LanguageCode == "en-utf8" ) {
616 $conf->LanguageCode = "en";
617 $conf->Encoding = "UTF-8";
619 $zlib = ($conf->zlib ? "" : "# ");
620 $magic = ($conf->ImageMagick ? "" : "# ");
621 $convert = ($conf->ImageMagick ? $conf->ImageMagick : "/usr/bin/convert" );
622 $pretty = ($conf->prettyURLs ? "" : "# ");
623 $ugly = ($conf->prettyURLs ? "# " : "");
625 $sep = (DIRECTORY_SEPARATOR == "\\") ? ";" : ":";
627 # This file was automatically generated by the MediaWiki installer.
628 # If you make manual changes, please keep track in case you need to
629 # recreate them later.
631 \$IP = \"{$conf->IP}\";
632 ini_set( \"include_path\", \"\$IP/includes$sep\$IP/languages$sep\" . ini_get(\"include_path\") );
633 include_once( \"DefaultSettings.php\" );
635 if( \$wgCommandLineMode ) {
636 die( \"Can't
use command
-line utils with in
-place install yet
, sorry
.\" );
638 ## Compress output if the browser supports it
639 {$zlib}if( !ini_get( 'zlib.output_compression' ) ) ob_start( 'ob_gzhandler' );
642 \
$wgSitename = \"{$conf->Sitename
}\";
644 \
$wgScriptPath = \"{$conf->ScriptPath
}\";
645 \
$wgScript = \"\
$wgScriptPath/index
.php\"
;
646 \
$wgRedirectScript = \"\
$wgScriptPath/redirect
.php\"
;
648 ## If using PHP as a CGI module, use the ugly URLs
649 {$pretty}\
$wgArticlePath = \"\
$wgScript/\
$1\";
650 {$ugly}\
$wgArticlePath = \"\
$wgScript?title
=\
$1\";
652 \
$wgStyleSheetPath = \"\
$wgScriptPath/stylesheets\"
;
653 \
$wgStyleSheetDirectory = \"\
$IP/stylesheets\"
;
655 \
$wgUploadPath = \"\
$wgScriptPath/images\"
;
656 \
$wgUploadDirectory = \"\
$IP/images\"
;
657 \
$wgLogo = \"\
$wgUploadPath/wiki
.png\"
;
659 \
$wgEmergencyContact = \"{$conf->EmergencyContact
}\";
660 \
$wgPasswordSender = \"{$conf->PasswordSender
}\";
662 \
$wgDBserver = \"{$conf->DBserver
}\";
663 \
$wgDBname = \"{$conf->DBname
}\";
664 \
$wgDBuser = \"{$conf->DBuser
}\";
665 \
$wgDBpassword = \"{$conf->DBpassword
}\";
667 ## To allow SQL queries through the wiki's Special:Askaql page,
668 ## uncomment the next lines. THIS IS VERY INSECURE. If you want
669 ## to allow semipublic read-only SQL access for your sysops,
670 ## you should define a MySQL user with limited privileges.
671 ## See MySQL docs: http://www.mysql.com/doc/en/GRANT.html
673 # \$wgAllowSysopQueries = true;
674 # \$wgDBsqluser = \"sqluser\";
675 # \$wgDBsqlpassword = \"sqlpass\";
677 \
$wgDBmysql4 = \
$wgEnablePersistentLC = {$conf->DBmysql4
};
679 ## To enable image uploads, make sure the 'images' directory
680 ## is writable, then uncomment this:
681 # \$wgDisableUploads = false;
682 \
$wgUseImageResize = {$conf->UseImageResize
};
683 {$magic}\
$wgUseImageMagick = true;
684 {$magic}\
$wgImageMagickConvertCommand = \"{$convert}\";
686 ## If you have the appropriate support software installed
687 ## you can enable inline LaTeX equations:
689 \
$wgMathPath = \"{\
$wgUploadPath}/math\"
;
690 \
$wgMathDirectory = \"{\
$wgUploadDirectory}/math\"
;
691 \
$wgTmpDirectory = \"{\
$wgUploadDirectory}/tmp\"
;
693 ## Experimental layout template subsystems
694 \
$wgUsePHPTal = false;
695 \
$wgUseSmarty = false;
696 if ( \
$wgUsePHPTal ) {
697 ini_set( \"include_path\"
, \"\
$IP/PHPTAL
-NP
-0.7.0/libs
$sep\" . ini_get(\"include_path\"
) );
699 if ( \
$wgUseSmarty ) {
700 ini_set( \"include_path\"
, \"\
$IP/Smarty
-2.6.2/libs
$sep\" . ini_get(\"include_path\"
) );
703 \
$wgLocalInterwiki = \
$wgSitename;
705 \
$wgLanguageCode = \"{$conf->LanguageCode
}\";
706 " . ($conf->Encoding ? "\
$wgInputEncoding = \
$wgOutputEncoding = \"{$conf->Encoding
}\";" : "" ) . "
711 function dieout( $text ) {
712 die( $text . "\n\n
</body
>\n</html
>" );
715 function importPost( $name, $default = "" ) {
716 if( isset( $_POST[$name] ) ) {
717 return $_POST[$name];
723 function aField( &$conf, $field, $text, $type = "" ) {
724 if( $type != "" ) $type = "type
=\"$type\"";
725 echo "\t\t
<label
for=\"$field\">$text</label
>\n";
726 echo "\t\t
<input
$type name
=\"$field\" id
=\"$field\" value
=\"";
727 echo htmlspecialchars( $conf->$field );
731 if(isset($errs[$field])) echo "<span
class='error'>" . $errs[$field] . "</span
>\n";
734 function getLanguageList() {
735 global $wgLanguageNames;
736 if( !isset( $wgLanguageNames ) ) {
737 $wgLanguageCode = "xxx
";
738 function wfLocalUrl( $x ) { return $x; }
739 function wfLocalUrlE( $x ) { return $x; }
740 include( "../languages
/Language
.php
" );
744 $latin1 = array( "da
", "de
", "en
", "es
", "nl
", "sv
" );
746 $d = opendir( "../languages
" );
747 while( false !== ($f = readdir( $d ) ) ) {
748 if( preg_match( '/Language([A-Z][a-z]+)\.php$/', $f, $m ) ) {
749 $code = strtolower( $m[1] );
750 $codes[$code] = "$code - " . $wgLanguageNames[$code];
751 if( in_array( $code, $latin1 ) ) {
752 $codes[$code] .= " - Latin
-1";
756 $codes["en
-utf8
"] = "en
- English
- Unicode
";