Merge maintenance-work branch:
[lhc/web/wiklou.git] / config / index.php
1 <?php
2
3 # MediaWiki web-based config/installation
4 # Copyright (C) 2004 Brion Vibber <brion@pobox.com>, 2006 Rob Church <robchur@gmail.com>
5 # http://www.mediawiki.org/
6 #
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
11 #
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
16 #
17 # You should have received a copy of the GNU General Public License along
18 # with this program; if not, write to the Free Software Foundation, Inc.,
19 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 # http://www.gnu.org/copyleft/gpl.html
21
22 error_reporting( E_ALL );
23 header( "Content-type: text/html; charset=utf-8" );
24 @ini_set( "display_errors", true );
25
26 # In case of errors, let output be clean.
27 $wgRequestTime = microtime( true );
28
29 # Attempt to set up the include path, to fix problems with relative includes
30 $IP = dirname( dirname( __FILE__ ) );
31 define( 'MW_INSTALL_PATH', $IP );
32
33 # Define an entry point and include some files
34 define( "MEDIAWIKI", true );
35 define( "MEDIAWIKI_INSTALL", true );
36
37 // Run version checks before including other files
38 // so people don't see a scary parse error.
39 require_once( "$IP/install-utils.inc" );
40 install_version_checks();
41
42 require_once( "$IP/includes/Defines.php" );
43 require_once( "$IP/includes/DefaultSettings.php" );
44 require_once( "$IP/includes/AutoLoader.php" );
45 require_once( "$IP/includes/MagicWord.php" );
46 require_once( "$IP/includes/Namespace.php" );
47 require_once( "$IP/includes/ProfilerStub.php" );
48 require_once( "$IP/includes/GlobalFunctions.php" );
49 require_once( "$IP/includes/Hooks.php" );
50 require_once( "$IP/includes/Exception.php" );
51
52 # If we get an exception, the user needs to know
53 # all the details
54 $wgShowExceptionDetails = true;
55 $wgShowSQLErrors = true;
56 wfInstallExceptionHandler();
57 ## Databases we support:
58
59 $ourdb = array();
60 $ourdb['mysql']['fullname'] = 'MySQL';
61 $ourdb['mysql']['havedriver'] = 0;
62 $ourdb['mysql']['compile'] = 'mysql';
63 $ourdb['mysql']['bgcolor'] = '#ffe5a7';
64 $ourdb['mysql']['rootuser'] = 'root';
65
66 $ourdb['postgres']['fullname'] = 'PostgreSQL';
67 $ourdb['postgres']['havedriver'] = 0;
68 $ourdb['postgres']['compile'] = 'pgsql';
69 $ourdb['postgres']['bgcolor'] = '#aaccff';
70 $ourdb['postgres']['rootuser'] = 'postgres';
71
72 $ourdb['sqlite']['fullname'] = 'SQLite';
73 $ourdb['sqlite']['havedriver'] = 0;
74 $ourdb['sqlite']['compile'] = 'pdo_sqlite';
75 $ourdb['sqlite']['bgcolor'] = '#b1ebb1';
76 $ourdb['sqlite']['rootuser'] = '';
77
78 $ourdb['mssql']['fullname'] = 'MSSQL';
79 $ourdb['mssql']['havedriver'] = 0;
80 $ourdb['mssql']['compile'] = 'mssql not ready'; # Change to 'mssql' after includes/DatabaseMssql.php added;
81 $ourdb['mssql']['bgcolor'] = '#ffc0cb';
82 $ourdb['mssql']['rootuser'] = 'administrator';
83
84 $ourdb['ibm_db2']['fullname'] = 'DB2';
85 $ourdb['ibm_db2']['havedriver'] = 0;
86 $ourdb['ibm_db2']['compile'] = 'ibm_db2';
87 $ourdb['ibm_db2']['bgcolor'] = '#ffeba1';
88 $ourdb['ibm_db2']['rootuser'] = 'db2admin';
89
90 $ourdb['oracle']['fullname'] = 'Oracle';
91 $ourdb['oracle']['havedriver'] = 0;
92 $ourdb['oracle']['compile'] = 'oci8';
93 $ourdb['oracle']['bgcolor'] = '#ffeba1';
94 $ourdb['oracle']['rootuser'] = '';
95
96 ?>
97 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
98 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
99 <head>
100 <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
101 <meta name="robots" content="noindex,nofollow"/>
102 <title>MediaWiki <?php echo htmlspecialchars( $wgVersion ); ?> Installation</title>
103 <style type="text/css">
104
105 @import "../skins/monobook/main.css";
106
107 .env-check {
108 font-size: 90%;
109 margin: 1em 0 1em 2.5em;
110 }
111
112 .config-section {
113 margin-top: 2em;
114 }
115
116 .config-section label.column {
117 clear: left;
118 font-weight: bold;
119 width: 13em;
120 float: left;
121 text-align: right;
122 padding-right: 1em;
123 padding-top: .2em;
124 }
125
126 .config-input {
127 clear: left;
128 zoom: 100%; /* IE hack */
129 }
130
131 .config-section .config-desc {
132 clear: left;
133 margin: 0 0 2em 18em;
134 padding-top: 1em;
135 font-size: 85%;
136 }
137
138 .iput-text, .iput-password {
139 width: 14em;
140 margin-right: 1em;
141 }
142
143 .error {
144 color: red;
145 background-color: #fff;
146 font-weight: bold;
147 left: 1em;
148 font-size: 100%;
149 }
150
151 .error-top {
152 color: red;
153 background-color: #FFF0F0;
154 border: 2px solid red;
155 font-size: 130%;
156 font-weight: bold;
157 padding: 1em 1.5em;
158 margin: 2em 0 1em;
159 }
160
161 ul.plain {
162 list-style-type: none;
163 list-style-image: none;
164 float: left;
165 margin: 0;
166 padding: 0;
167 }
168
169 .btn-install {
170 font-weight: bold;
171 font-size: 110%;
172 padding: .2em .3em;
173 }
174
175 .license {
176 font-size: 85%;
177 padding-top: 3em;
178 }
179
180 span.success-message {
181 font-weight: bold;
182 font-size: 110%;
183 color: green;
184 }
185 .success-box {
186 font-size: 130%;
187 }
188
189 </style>
190 <script type="text/javascript">
191 <!--
192 function hideall() {
193 <?php foreach (array_keys($ourdb) as $db) {
194 echo "\n var i = document.getElementById('$db'); if (i) i.style.display='none';";
195 }
196 ?>
197
198 }
199 function toggleDBarea(id,defaultroot) {
200 hideall();
201 var dbarea = document.getElementById(id);
202 if (dbarea) dbarea.style.display = (dbarea.style.display == 'none') ? 'block' : 'none';
203 var db = document.getElementById('RootUser');
204 if (defaultroot) {
205 <?php foreach (array_keys($ourdb) as $db) {
206 echo " if (id == '$db') { db.value = '".$ourdb[$db]['rootuser']."';}\n";
207 }?>
208 }
209 }
210 // -->
211 </script>
212 </head>
213
214 <body>
215 <div id="globalWrapper">
216 <div id="column-content">
217 <div id="content">
218 <div id="bodyContent">
219
220 <h1>MediaWiki <?php print htmlspecialchars( $wgVersion ) ?> Installation</h1>
221
222 <?php
223 $mainListOpened = false; # Is the main list (environement checking) opend ? Used by dieout
224
225 /* Check for existing configurations and bug out! */
226
227 if( file_exists( "../LocalSettings.php" ) ) {
228 $script = defined('MW_INSTALL_PHP5_EXT') ? 'index.php5' : 'index.php';
229 dieout( "<p><strong>Setup has completed, <a href='../$script'>your wiki</a> is configured.</strong></p>
230 <p>Please delete the /config directory for extra security.</p>" );
231 }
232
233 if( file_exists( "./LocalSettings.php" ) ) {
234 writeSuccessMessage();
235 dieout( '' );
236 }
237
238 if( !is_writable( "." ) ) {
239 dieout( "<h2>Can't write config file, aborting</h2>
240
241 <p>In order to configure the wiki you have to make the <tt>config</tt> subdirectory
242 writable by the web server. Once configuration is done you'll move the created
243 <tt>LocalSettings.php</tt> to the parent directory, and for added safety you can
244 then remove the <tt>config</tt> subdirectory entirely.</p>
245
246 <p>To make the directory writable on a Unix/Linux system:</p>
247
248 <pre>
249 cd <i>/path/to/wiki</i>
250 chmod a+w config
251 </pre>
252
253 <p>Afterwards retry to start the <a href=\"\">setup</a>.</p>" );
254 }
255
256
257 require_once( "$IP/install-utils.inc" );
258 require_once( "$IP/maintenance/updaters.inc" );
259
260 class ConfigData {
261 function getEncoded( $data ) {
262 # removing latin1 support, no need...
263 return $data;
264 }
265 function getSitename() { return $this->getEncoded( $this->Sitename ); }
266 function getSysopName() { return $this->getEncoded( $this->SysopName ); }
267 function getSysopPass() { return $this->getEncoded( $this->SysopPass ); }
268
269 function setSchema( $schema, $engine ) {
270 $this->DBschema = $schema;
271 if ( !preg_match( '/^\w*$/', $engine ) ){
272 $engine = 'InnoDB';
273 }
274 switch ( $this->DBschema ) {
275 case 'mysql5':
276 $this->DBTableOptions = "ENGINE=$engine, DEFAULT CHARSET=utf8";
277 $this->DBmysql5 = 'true';
278 break;
279 case 'mysql5-binary':
280 $this->DBTableOptions = "ENGINE=$engine, DEFAULT CHARSET=binary";
281 $this->DBmysql5 = 'true';
282 break;
283 default:
284 $this->DBTableOptions = "TYPE=$engine";
285 $this->DBmysql5 = 'false';
286 }
287 $this->DBengine = $engine;
288
289 # Set the global for use during install
290 global $wgDBTableOptions;
291 $wgDBTableOptions = $this->DBTableOptions;
292 }
293 }
294
295 ?>
296
297 <ul>
298 <li>
299 <b>Don't forget security updates!</b> Keep an eye on the
300 <a href="http://lists.wikimedia.org/mailman/listinfo/mediawiki-announce">low-traffic
301 release announcements mailing list</a>.
302 </li>
303 </ul>
304
305
306 <h2>Checking environment...</h2>
307 <p><em>Please include all of the lines below when reporting installation problems.</em></p>
308 <ul class="env-check">
309 <?php
310 $mainListOpened = true;
311
312 $endl = "
313 ";
314 define( 'MW_NO_OUTPUT_BUFFER', 1 );
315 $conf = new ConfigData;
316
317 install_version_checks();
318 $self = 'Installer'; # Maintenance script name, to please Setup.php
319
320 print "<li>PHP " . htmlspecialchars( phpversion() ) . " installed</li>\n";
321
322 error_reporting( 0 );
323 $phpdatabases = array();
324 foreach (array_keys($ourdb) as $db) {
325 $compname = $ourdb[$db]['compile'];
326 if( extension_loaded( $compname ) || ( mw_have_dl() && dl( "{$compname}." . PHP_SHLIB_SUFFIX ) ) ) {
327 array_push($phpdatabases, $db);
328 $ourdb[$db]['havedriver'] = 1;
329 }
330 }
331 error_reporting( E_ALL );
332
333 if (!$phpdatabases) {
334 print "Could not find a suitable database driver!<ul>";
335 foreach (array_keys($ourdb) AS $db) {
336 $comp = $ourdb[$db]['compile'];
337 $full = $ourdb[$db]['fullname'];
338 print "<li>For <b>$full</b>, compile PHP using <b>--with-$comp</b>, "
339 ."or install the $comp.so module</li>\n";
340 }
341 echo '</ul>';
342 dieout( '' );
343 }
344
345 print "<li>Found database drivers for:";
346 $DefaultDBtype = '';
347 foreach (array_keys($ourdb) AS $db) {
348 if ($ourdb[$db]['havedriver']) {
349 if ( $DefaultDBtype == '' ) {
350 $DefaultDBtype = $db;
351 }
352 print " ".$ourdb[$db]['fullname'];
353 }
354 }
355 print "</li>\n";
356
357 if( wfIniGetBool( "register_globals" ) ) {
358 ?>
359 <li>
360 <div style="font-size:110%">
361 <strong class="error">Warning:</strong>
362 <strong>PHP's <tt><a href="http://php.net/register_globals">register_globals</a></tt> option is enabled. Disable it if you can.</strong>
363 </div>
364 MediaWiki will work, but your server is more exposed to PHP-based security vulnerabilities.
365 </li>
366 <?php
367 }
368
369 $fatal = false;
370
371 if( wfIniGetBool( "magic_quotes_runtime" ) ) {
372 $fatal = true;
373 ?><li class='error'><strong>Fatal: <a href='http://www.php.net/manual/en/ref.info.php#ini.magic-quotes-runtime'>magic_quotes_runtime</a> is active!</strong>
374 This option corrupts data input unpredictably; you cannot install or use
375 MediaWiki unless this option is disabled.</li>
376 <?php
377 }
378
379 if( wfIniGetBool( "magic_quotes_sybase" ) ) {
380 $fatal = true;
381 ?><li class='error'><strong>Fatal: <a href='http://www.php.net/manual/en/ref.sybase.php#ini.magic-quotes-sybase'>magic_quotes_sybase</a> is active!</strong>
382 This option corrupts data input unpredictably; you cannot install or use
383 MediaWiki unless this option is disabled.</li>
384 <?php
385 }
386
387 if( wfIniGetBool( "mbstring.func_overload" ) ) {
388 $fatal = true;
389 ?><li class='error'><strong>Fatal: <a href='http://www.php.net/manual/en/ref.mbstring.php#mbstring.overload'>mbstring.func_overload</a> is active!</strong>
390 This option causes errors and may corrupt data unpredictably;
391 you cannot install or use MediaWiki unless this option is disabled.</li>
392 <?php
393 }
394
395 if( wfIniGetBool( "zend.ze1_compatibility_mode" ) ) {
396 $fatal = true;
397 ?><li class="error"><strong>Fatal: <a href="http://www.php.net/manual/en/ini.core.php">zend.ze1_compatibility_mode</a> is active!</strong>
398 This option causes horrible bugs with MediaWiki; you cannot install or use
399 MediaWiki unless this option is disabled.</li>
400 <?php
401 }
402
403
404 if( $fatal ) {
405 dieout( "Cannot install MediaWiki." );
406 }
407
408 if( wfIniGetBool( "safe_mode" ) ) {
409 $conf->safeMode = true;
410 ?>
411 <li><b class='error'>Warning:</b> <strong>PHP's
412 <a href='http://www.php.net/features.safe-mode'>safe mode</a> is active.</strong>
413 You may have problems caused by this, particularly if using image uploads.
414 </li>
415 <?php
416 } else {
417 $conf->safeMode = false;
418 }
419
420 $sapi = htmlspecialchars( php_sapi_name() );
421 print "<li>PHP server API is $sapi; ";
422 $script = defined('MW_INSTALL_PHP5_EXT') ? 'index.php5' : 'index.php';
423 if( $wgUsePathInfo ) {
424 print "ok, using pretty URLs (<tt>$script/Page_Title</tt>)";
425 } else {
426 print "using ugly URLs (<tt>$script?title=Page_Title</tt>)";
427 }
428 print "</li>\n";
429
430 $conf->xml = function_exists( "utf8_encode" );
431 if( $conf->xml ) {
432 print "<li>Have XML / Latin1-UTF-8 conversion support.</li>\n";
433 } else {
434 dieout( "PHP's XML module is missing; the wiki requires functions in
435 this module and won't work in this configuration.
436 If you're running Mandrake, install the php-xml package." );
437 }
438
439 # Check for session support
440 if( !function_exists( 'session_name' ) )
441 dieout( "PHP's session module is missing. MediaWiki requires session support in order to function." );
442
443 # session.save_path doesn't *have* to be set, but if it is, and it's
444 # not valid/writable/etc. then it can cause problems
445 $sessionSavePath = mw_get_session_save_path();
446 $ssp = htmlspecialchars( $sessionSavePath );
447 # Warn the user if it's not set, but let them proceed
448 if( !$sessionSavePath ) {
449 print "<li><strong>Warning:</strong> A value for <tt>session.save_path</tt>
450 has not been set in PHP.ini. If the default value causes problems with
451 saving session data, set it to a valid path which is read/write/execute
452 for the user your web server is running under.</li>";
453 } elseif ( is_dir( $sessionSavePath ) && is_writable( $sessionSavePath ) ) {
454 # All good? Let the user know
455 print "<li>Session save path (<tt>{$ssp}</tt>) appears to be valid.</li>";
456 } else {
457 # Something not right? Warn the user, but let them proceed
458 print "<li><strong>Warning:</strong> Your <tt>session.save_path</tt> value (<tt>{$ssp}</tt>)
459 appears to be invalid or is not writable. PHP needs to be able to save data to
460 this location for correct session operation.</li>";
461 }
462
463 # Check for PCRE support
464 if( !function_exists( 'preg_match' ) )
465 dieout( "The PCRE support module appears to be missing. MediaWiki requires the
466 Perl-compatible regular expression functions." );
467
468 $memlimit = ini_get( "memory_limit" );
469 $conf->raiseMemory = false;
470 if( empty( $memlimit ) || $memlimit == -1 ) {
471 print "<li>PHP is configured with no <tt>memory_limit</tt>.</li>\n";
472 } else {
473 print "<li>PHP's <tt>memory_limit</tt> is " . htmlspecialchars( $memlimit ) . ". ";
474 $n = intval( $memlimit );
475 if( preg_match( '/^([0-9]+)[Mm]$/', trim( $memlimit ), $m ) ) {
476 $n = intval( $m[1] * (1024*1024) );
477 }
478 if( $n < 20*1024*1024 ) {
479 print "Attempting to raise limit to 20M... ";
480 if( false === ini_set( "memory_limit", "20M" ) ) {
481 print "failed.<br /><b>" . htmlspecialchars( $memlimit ) . " seems too low, installation may fail!</b>";
482 } else {
483 $conf->raiseMemory = true;
484 print "ok.";
485 }
486 }
487 print "</li>\n";
488 }
489
490 $conf->turck = function_exists( 'mmcache_get' );
491 if ( $conf->turck ) {
492 print "<li><a href=\"http://turck-mmcache.sourceforge.net/\">Turck MMCache</a> installed</li>\n";
493 }
494
495 $conf->xcache = function_exists( 'xcache_get' );
496 if( $conf->xcache )
497 print "<li><a href=\"http://trac.lighttpd.net/xcache/\">XCache</a> installed</li>\n";
498
499 $conf->apc = function_exists('apc_fetch');
500 if ($conf->apc ) {
501 print "<li><a href=\"http://www.php.net/apc\">APC</a> installed</li>\n";
502 }
503
504 $conf->eaccel = function_exists( 'eaccelerator_get' );
505 if ( $conf->eaccel ) {
506 $conf->turck = 'eaccelerator';
507 print "<li><a href=\"http://eaccelerator.sourceforge.net/\">eAccelerator</a> installed</li>\n";
508 }
509
510 $conf->dba = function_exists( 'dba_open' );
511
512 if( !( $conf->turck || $conf->eaccel || $conf->apc || $conf->xcache ) ) {
513 echo( '<li>Couldn\'t find <a href="http://turck-mmcache.sourceforge.net">Turck MMCache</a>,
514 <a href="http://eaccelerator.sourceforge.net">eAccelerator</a>,
515 <a href="http://www.php.net/apc">APC</a> or <a href="http://trac.lighttpd.net/xcache/">XCache</a>;
516 cannot use these for object caching.</li>' );
517 }
518
519 $conf->diff3 = false;
520 $diff3locations = array_merge(
521 array(
522 "/usr/bin",
523 "/usr/local/bin",
524 "/opt/csw/bin",
525 "/usr/gnu/bin",
526 "/usr/sfw/bin" ),
527 explode( PATH_SEPARATOR, getenv( "PATH" ) ) );
528 $diff3names = array( "gdiff3", "diff3", "diff3.exe" );
529
530 $diff3versioninfo = array( '$1 --version 2>&1', 'diff3 (GNU diffutils)' );
531 foreach ($diff3locations as $loc) {
532 $exe = locate_executable($loc, $diff3names, $diff3versioninfo);
533 if ($exe !== false) {
534 $conf->diff3 = $exe;
535 break;
536 }
537 }
538
539 if ($conf->diff3)
540 print "<li>Found GNU diff3: <tt>$conf->diff3</tt>.</li>";
541 else
542 print "<li>GNU diff3 not found.</li>";
543
544 $conf->ImageMagick = false;
545 $imcheck = array( "/usr/bin", "/opt/csw/bin", "/usr/local/bin", "/sw/bin", "/opt/local/bin" );
546 foreach( $imcheck as $dir ) {
547 $im = "$dir/convert";
548 if( @file_exists( $im ) ) {
549 print "<li>Found ImageMagick: <tt>$im</tt>; image thumbnailing will be enabled if you enable uploads.</li>\n";
550 $conf->ImageMagick = $im;
551 break;
552 }
553 }
554
555 $conf->HaveGD = function_exists( "imagejpeg" );
556 if( $conf->HaveGD ) {
557 print "<li>Found GD graphics library built-in";
558 if( !$conf->ImageMagick ) {
559 print ", image thumbnailing will be enabled if you enable uploads";
560 }
561 print ".</li>\n";
562 } else {
563 if( !$conf->ImageMagick ) {
564 print "<li>Couldn't find GD library or ImageMagick; image thumbnailing disabled.</li>\n";
565 }
566 }
567
568 $conf->IP = dirname( dirname( __FILE__ ) );
569 print "<li>Installation directory: <tt>" . htmlspecialchars( $conf->IP ) . "</tt></li>\n";
570
571
572 // PHP_SELF isn't available sometimes, such as when PHP is CGI but
573 // cgi.fix_pathinfo is disabled. In that case, fall back to SCRIPT_NAME
574 // to get the path to the current script... hopefully it's reliable. SIGH
575 $path = ($_SERVER["PHP_SELF"] === '')
576 ? $_SERVER["SCRIPT_NAME"]
577 : $_SERVER["PHP_SELF"];
578
579 $conf->ScriptPath = preg_replace( '{^(.*)/config.*$}', '$1', $path );
580 print "<li>Script URI path: <tt>" . htmlspecialchars( $conf->ScriptPath ) . "</tt></li>\n";
581
582
583
584 // We may be installing from *.php5 extension file, if so, print message
585 $conf->ScriptExtension = '.php';
586 if (defined('MW_INSTALL_PHP5_EXT')) {
587 $conf->ScriptExtension = '.php5';
588 print "<li>Installing MediaWiki with <tt>php5</tt> file extensions</li>\n";
589 } else {
590 print "<li>Installing MediaWiki with <tt>php</tt> file extensions</li>\n";
591 }
592
593
594 print "<li style='font-weight:bold;color:green;font-size:110%'>Environment checked. You can install MediaWiki.</li>\n";
595 $conf->posted = ($_SERVER["REQUEST_METHOD"] == "POST");
596
597 $conf->Sitename = ucfirst( importPost( "Sitename", "" ) );
598 $defaultEmail = empty( $_SERVER["SERVER_ADMIN"] )
599 ? 'root@localhost'
600 : $_SERVER["SERVER_ADMIN"];
601 $conf->EmergencyContact = importPost( "EmergencyContact", $defaultEmail );
602 $conf->DBtype = importPost( "DBtype", $DefaultDBtype );
603 if ( !isset( $ourdb[$conf->DBtype] ) ) {
604 $conf->DBtype = $DefaultDBtype;
605 }
606
607 $conf->DBserver = importPost( "DBserver", "localhost" );
608 $conf->DBname = importPost( "DBname", "wikidb" );
609 $conf->DBuser = importPost( "DBuser", "wikiuser" );
610 $conf->DBpassword = importPost( "DBpassword" );
611 $conf->DBpassword2 = importPost( "DBpassword2" );
612 $conf->SysopName = importPost( "SysopName", "WikiSysop" );
613 $conf->SysopPass = importPost( "SysopPass" );
614 $conf->SysopPass2 = importPost( "SysopPass2" );
615 $conf->RootUser = importPost( "RootUser", "root" );
616 $conf->RootPW = importPost( "RootPW", "" );
617 $useRoot = importCheck( 'useroot', false );
618 $conf->populateadmin = importCheck( 'populateadmin', false );
619 $conf->LanguageCode = importPost( "LanguageCode", "en" );
620 ## MySQL specific:
621 $conf->DBprefix = importPost( "DBprefix" );
622 $conf->setSchema(
623 importPost( "DBschema", "mysql5-binary" ),
624 importPost( "DBengine", "InnoDB" ) );
625
626 ## Postgres specific:
627 $conf->DBport = importPost( "DBport", "5432" );
628 $conf->DBmwschema = importPost( "DBmwschema", "mediawiki" );
629 $conf->DBts2schema = importPost( "DBts2schema", "public" );
630
631 ## SQLite specific
632 $conf->SQLiteDataDir = importPost( "SQLiteDataDir", "" );
633
634 ## MSSQL specific
635 // We need a second field so it doesn't overwrite the MySQL one
636 $conf->DBprefix2 = importPost( "DBprefix2" );
637
638 ## DB2 specific:
639 // New variable in order to have a different default port number
640 $conf->DBport_db2 = importPost( "DBport_db2", "50000" );
641 $conf->DBmwschema = importPost( "DBmwschema", "mediawiki" );
642 $conf->DBcataloged = importPost( "DBcataloged", "cataloged" );
643
644 // Oracle specific
645 $conf->DBprefix_ora = importPost( "DBprefix_ora" );
646 $conf->DBdefTS_ora = importPost( "DBdefTS_ora", "USERS" );
647 $conf->DBtempTS_ora = importPost( "DBtempTS_ora", "TEMP" );
648
649 $conf->ShellLocale = getShellLocale( $conf->LanguageCode );
650
651 /* Check for validity */
652 $errs = array();
653
654 if( preg_match( '/^$|^mediawiki$|#/i', $conf->Sitename ) ) {
655 $errs["Sitename"] = "Must not be blank or \"MediaWiki\" and may not contain \"#\"";
656 }
657 if( $conf->DBuser == "" ) {
658 $errs["DBuser"] = "Must not be blank";
659 }
660 if( ($conf->DBtype == 'mysql') && (strlen($conf->DBuser) > 16) ) {
661 $errs["DBuser"] = "Username too long";
662 }
663 if( $conf->DBpassword == "" && $conf->DBtype != "postgres" ) {
664 $errs["DBpassword"] = "Must not be blank";
665 }
666 if( $conf->DBpassword != $conf->DBpassword2 ) {
667 $errs["DBpassword2"] = "Passwords don't match!";
668 }
669 if( !preg_match( '/^[A-Za-z_0-9]*$/', $conf->DBprefix ) ) {
670 $errs["DBprefix"] = "Invalid table prefix";
671 } else {
672 untaint( $conf->DBprefix, TC_MYSQL );
673 }
674 if( !preg_match( '/^[A-Za-z_0-9]*$/', $conf->DBprefix_ora ) ) {
675 $errs["DBprefix_ora"] = "Invalid table prefix";
676 }
677
678 error_reporting( E_ALL );
679
680 /**
681 * Initialise $wgLang and $wgContLang to something so we can
682 * call case-folding methods. Per Brion, this is English for
683 * now, although we could be clever and initialise to the
684 * user-selected language.
685 */
686 $wgContLang = Language::factory( 'en' );
687 $wgLang = $wgContLang;
688
689 /**
690 * We're messing about with users, so we need a stub
691 * authentication plugin...
692 */
693 $wgAuth = new AuthPlugin();
694
695 /**
696 * Validate the initial administrator account; username,
697 * password checks, etc.
698 */
699 if( $conf->SysopName ) {
700 # Check that the user can be created
701 $u = User::newFromName( $conf->SysopName );
702 if( is_a($u, 'User') ) { // please do not use instanceof, it breaks PHP4
703 # Various password checks
704 if( $conf->SysopPass != '' ) {
705 if( $conf->SysopPass == $conf->SysopPass2 ) {
706 if( !$u->isValidPassword( $conf->SysopPass ) ) {
707 $errs['SysopPass'] = "Bad password";
708 }
709 } else {
710 $errs['SysopPass2'] = "Passwords don't match";
711 }
712 } else {
713 $errs['SysopPass'] = "Cannot be blank";
714 }
715 unset( $u );
716 } else {
717 $errs['SysopName'] = "Bad username";
718 }
719 }
720
721 $conf->License = importRequest( "License", "none" );
722 if( $conf->License == "gfdl1_2" ) {
723 $conf->RightsUrl = "http://www.gnu.org/licenses/old-licenses/fdl-1.2.txt";
724 $conf->RightsText = "GNU Free Documentation License 1.2";
725 $conf->RightsCode = "gfdl1_2";
726 $conf->RightsIcon = '${wgScriptPath}/skins/common/images/gnu-fdl.png';
727 } elseif( $conf->License == "gfdl1_3" ) {
728 $conf->RightsUrl = "http://www.gnu.org/copyleft/fdl.html";
729 $conf->RightsText = "GNU Free Documentation License 1.3";
730 $conf->RightsCode = "gfdl1_3";
731 $conf->RightsIcon = '${wgScriptPath}/skins/common/images/gnu-fdl.png';
732 } elseif( $conf->License == "none" ) {
733 $conf->RightsUrl = $conf->RightsText = $conf->RightsCode = $conf->RightsIcon = "";
734 } elseif( $conf->License == "pd" ) {
735 $conf->RightsUrl = "http://creativecommons.org/licenses/publicdomain/";
736 $conf->RightsText = "Public Domain";
737 $conf->RightsCode = "pd";
738 $conf->RightsIcon = '${wgScriptPath}/skins/common/images/public-domain.png';
739 } else {
740 $conf->RightsUrl = importRequest( "RightsUrl", "" );
741 $conf->RightsText = importRequest( "RightsText", "" );
742 $conf->RightsCode = importRequest( "RightsCode", "" );
743 $conf->RightsIcon = importRequest( "RightsIcon", "" );
744 }
745
746 $conf->Shm = importRequest( "Shm", "none" );
747 $conf->MCServers = importRequest( "MCServers" );
748
749 /* Test memcached servers */
750
751 if ( $conf->Shm == 'memcached' && $conf->MCServers ) {
752 $conf->MCServerArray = wfArrayMap( 'trim', explode( ',', $conf->MCServers ) );
753 foreach ( $conf->MCServerArray as $server ) {
754 $error = testMemcachedServer( $server );
755 if ( $error ) {
756 $errs["MCServers"] = $error;
757 break;
758 }
759 }
760 } else if ( $conf->Shm == 'memcached' ) {
761 $errs["MCServers"] = "Please specify at least one server if you wish to use memcached";
762 }
763
764 /* default values for installation */
765 $conf->Email = importRequest("Email", "email_enabled");
766 $conf->Emailuser = importRequest("Emailuser", "emailuser_enabled");
767 $conf->Enotif = importRequest("Enotif", "enotif_allpages");
768 $conf->Eauthent = importRequest("Eauthent", "eauthent_enabled");
769
770 if( $conf->posted && ( 0 == count( $errs ) ) ) {
771 do { /* So we can 'continue' to end prematurely */
772 $conf->Root = ($conf->RootPW != "");
773
774 /* Load up the settings and get installin' */
775 $local = writeLocalSettings( $conf );
776 echo "<li style=\"list-style: none\">\n";
777 echo "<p><b>Generating configuration file...</b></p>\n";
778 echo "</li>\n";
779
780 $wgCommandLineMode = false;
781 chdir( ".." );
782 $ok = eval( $local );
783 if( $ok === false ) {
784 dieout( "<p>Errors in generated configuration; " .
785 "most likely due to a bug in the installer... " .
786 "Config file was: </p>" .
787 "<pre>" .
788 htmlspecialchars( $local ) .
789 "</pre>" );
790 }
791 $conf->DBtypename = '';
792 foreach (array_keys($ourdb) as $db) {
793 if ($conf->DBtype === $db)
794 $conf->DBtypename = $ourdb[$db]['fullname'];
795 }
796 if ( ! strlen($conf->DBtype)) {
797 $errs["DBpicktype"] = "Please choose a database type";
798 continue;
799 }
800
801 if (! $conf->DBtypename) {
802 $errs["DBtype"] = "Unknown database type '$conf->DBtype'";
803 continue;
804 }
805 print "<li>Database type: " . htmlspecialchars( $conf->DBtypename ) . "</li>\n";
806 $dbclass = 'Database'.ucfirst($conf->DBtype);
807 $wgDBtype = $conf->DBtype;
808 $wgDBadminuser = "root";
809 $wgDBadminpassword = $conf->RootPW;
810
811 ## Mysql specific:
812 $wgDBprefix = $conf->DBprefix;
813
814 ## Postgres specific:
815 $wgDBport = $conf->DBport;
816 $wgDBmwschema = $conf->DBmwschema;
817 $wgDBts2schema = $conf->DBts2schema;
818
819 if( $conf->DBprefix2 != '' ) {
820 // For MSSQL
821 $wgDBprefix = $conf->DBprefix2;
822 } elseif( $conf->DBprefix_ora != '' ) {
823 // For Oracle
824 $wgDBprefix = $conf->DBprefix_ora;
825 }
826
827 ## DB2 specific:
828 $wgDBcataloged = $conf->DBcataloged;
829
830 $wgCommandLineMode = true;
831 if (! defined ( 'STDERR' ) )
832 define( 'STDERR', fopen("php://stderr", "wb"));
833 $wgUseDatabaseMessages = false; /* FIXME: For database failure */
834 require_once( "$IP/includes/Setup.php" );
835 chdir( "config" );
836
837 $wgTitle = Title::newFromText( "Installation script" );
838 error_reporting( E_ALL );
839 print "<li>Loading class: " . htmlspecialchars( $dbclass ) . "</li>\n";
840 if ( $conf->DBtype != 'sqlite' ) {
841 $dbc = new $dbclass;
842 }
843
844 if( $conf->DBtype == 'mysql' ) {
845 $mysqlOldClient = version_compare( mysql_get_client_info(), "4.1.0", "lt" );
846 if( $mysqlOldClient ) {
847 print "<li><b>PHP is linked with old MySQL client libraries. If you are
848 using a MySQL 4.1 server and have problems connecting to the database,
849 see <a href='http://dev.mysql.com/doc/mysql/en/old-client.html'
850 >http://dev.mysql.com/doc/mysql/en/old-client.html</a> for help.</b></li>\n";
851 }
852 $ok = true; # Let's be optimistic
853
854 # Decide if we're going to use the superuser or the regular database user
855 $conf->Root = $useRoot;
856 if( $conf->Root ) {
857 $db_user = $conf->RootUser;
858 $db_pass = $conf->RootPW;
859 } else {
860 $db_user = $wgDBuser;
861 $db_pass = $wgDBpassword;
862 }
863
864 # Attempt to connect
865 echo( "<li>Attempting to connect to database server as " . htmlspecialchars( $db_user ) . "..." );
866 $wgDatabase = Database::newFromParams( $wgDBserver, $db_user, $db_pass, '', 1 );
867
868 # Check the connection and respond to errors
869 if( $wgDatabase->isOpen() ) {
870 # Seems OK
871 $ok = true;
872 $wgDBadminuser = $db_user;
873 $wgDBadminpassword = $db_pass;
874 echo( "success.</li>\n" );
875 $wgDatabase->ignoreErrors( true );
876 $myver = $wgDatabase->getServerVersion();
877 } else {
878 # There were errors, report them and back out
879 $ok = false;
880 $errno = mysql_errno();
881 $errtx = htmlspecialchars( mysql_error() );
882 switch( $errno ) {
883 case 1045:
884 case 2000:
885 echo( "failed due to authentication errors. Check passwords.</li>" );
886 if( $conf->Root ) {
887 # The superuser details are wrong
888 $errs["RootUser"] = "Check username";
889 $errs["RootPW"] = "and password";
890 } else {
891 # The regular user details are wrong
892 $errs["DBuser"] = "Check username";
893 $errs["DBpassword"] = "and password";
894 }
895 break;
896 case 2002:
897 case 2003:
898 default:
899 # General connection problem
900 echo( htmlspecialchars( "failed with error [$errno] $errtx." ) . "</li>\n" );
901 $errs["DBserver"] = "Connection failed";
902 break;
903 } # switch
904 } #conn. att.
905
906 if( !$ok ) { continue; }
907 }
908 else if( $conf->DBtype == 'ibm_db2' ) {
909 if( $useRoot ) {
910 $db_user = $conf->RootUser;
911 $db_pass = $conf->RootPW;
912 } else {
913 $db_user = $wgDBuser;
914 $db_pass = $wgDBpassword;
915 }
916
917 echo( "<li>Attempting to connect to database \"" . htmlspecialchars( $wgDBname ) .
918 "\" as \"" . htmlspecialchars( $db_user ) . "\"..." );
919 $wgDatabase = $dbc->newFromParams($wgDBserver, $db_user, $db_pass, $wgDBname, 1);
920 if (!$wgDatabase->isOpen()) {
921 print " error: " . htmlspecialchars( $wgDatabase->lastError() ) . "</li>\n";
922 } else {
923 $myver = $wgDatabase->getServerVersion();
924 }
925 if (is_callable(array($wgDatabase, 'initial_setup'))) $wgDatabase->initial_setup('', $wgDBname);
926
927 } elseif ( $conf->DBtype == 'sqlite' ) {
928 if ("$wgSQLiteDataDir" == '') {
929 $wgSQLiteDataDir = dirname($_SERVER['DOCUMENT_ROOT']).'/data';
930 }
931 echo "<li>Attempting to connect to SQLite database at \"" .
932 htmlspecialchars( $wgSQLiteDataDir ) . "\"";
933 if ( !is_dir( $wgSQLiteDataDir ) ) {
934 if ( is_writable( dirname( $wgSQLiteDataDir ) ) ) {
935 $ok = wfMkdirParents( $wgSQLiteDataDir, $wgSQLiteDataDirMode );
936 } else {
937 $ok = false;
938 }
939 if ( !$ok ) {
940 echo ": cannot create data directory</li>";
941 $errs['SQLiteDataDir'] = 'Enter a valid data directory';
942 continue;
943 }
944 }
945 if ( !is_writable( $wgSQLiteDataDir ) ) {
946 echo ": data directory not writable</li>";
947 $errs['SQLiteDataDir'] = 'Enter a writable data directory';
948 continue;
949 }
950 $dataFile = "$wgSQLiteDataDir/$wgDBname.sqlite";
951 if ( file_exists( $dataFile ) && !is_writable( $dataFile ) ) {
952 echo ": data file not writable</li>";
953 $errs['SQLiteDataDir'] = "$wgDBname.sqlite is not writable";
954 continue;
955 }
956 $wgDatabase = new DatabaseSqlite( false, false, false, $wgDBname, 1 );
957 if (!$wgDatabase->isOpen()) {
958 print ": error: " . htmlspecialchars( $wgDatabase->lastError() ) . "</li>\n";
959 $errs['SQLiteDataDir'] = 'Could not connect to database';
960 continue;
961 } else {
962 $myver = $wgDatabase->getServerVersion();
963 }
964 if (is_callable(array($wgDatabase, 'initial_setup'))) $wgDatabase->initial_setup('', $wgDBname);
965 echo "ok</li>\n";
966 } elseif ( $conf->DBtype == 'oracle' ) {
967 echo "<li>Attempting to connect to database \"" . htmlspecialchars( $wgDBname ) ."\"</li>";
968 $wgDatabase = $dbc->newFromParams('DUMMY', $wgDBuser, $wgDBpassword, $wgDBname, 1);
969 if (!$wgDatabase->isOpen()) {
970 $ok = true;
971 echo "<li>Connect failed.</li>";
972 if ($useRoot) {
973 if (ini_get('oci8.privileged_connect') === false) {
974 echo "<li>Privileged connect disabled, please set oci8.privileged_connect or run maintenance/ora/user.sql script manually prior to continuing.</li>";
975 $ok = false;
976 } else {
977 $wgDBadminuser = $conf->RootUser;
978 $wgDBadminpassword = $conf->RootPW;
979 echo "<li>Attempting to create DB user.</li>";
980 $wgDatabase = $dbc->newFromParams('DUMMY', $wgDBadminuser, $wgDBadminpassword, $wgDBname, 1, 64);
981 if ($wgDatabase->isOpen()) {
982 $wgDBOracleDefTS = $conf->DBdefTS_ora;
983 $wgDBOracleTempTS = $conf->DBtempTS_ora;
984 dbsource( "../maintenance/ora/user.sql", $wgDatabase );
985 } else {
986 echo "<li>Invalid database superuser, please supply a valid superuser account.</li>";
987 echo "<li>ERR: ".print_r(oci_error(), true)."</li>";
988 $ok = false;
989 }
990 }
991 } else {
992 echo "<li>Database superuser missing, please supply a valid superuser account.</li>";
993 $ok = false;
994 }
995 if (!$ok) {
996 $errs["RootUser"] = "Check username";
997 $errs["RootPW"] = "and password";
998 } else {
999 echo "<li>Attempting to connect to database with new user \"" . htmlspecialchars( $wgDBname ) ."\"</li>";
1000 $wgDatabase = $dbc->newFromParams('DUMMY', $wgDBuser, $wgDBpassword, $wgDBname, 1);
1001 }
1002 }
1003 if ($ok) {
1004 $myver = $wgDatabase->getServerVersion();
1005 }
1006 } else { # not mysql
1007 error_reporting( E_ALL );
1008 $wgSuperUser = '';
1009 ## Possible connect as a superuser
1010 // Changed !mysql to postgres check since it seems to only apply to postgres
1011 if( $useRoot && $conf->DBtype == 'postgres' ) {
1012 $wgDBsuperuser = $conf->RootUser;
1013 echo( "<li>Attempting to connect to database \"postgres\" as superuser \"" .
1014 htmlspecialchars( $wgDBsuperuser ) . "\"..." );
1015 $wgDatabase = $dbc->newFromParams($wgDBserver, $wgDBsuperuser, $conf->RootPW, "postgres", 1);
1016 if (!$wgDatabase->isOpen()) {
1017 print " error: " . htmlspecialchars( $wgDatabase->lastError() ) . "</li>\n";
1018 $errs["DBserver"] = "Could not connect to database as superuser";
1019 $errs["RootUser"] = "Check username";
1020 $errs["RootPW"] = "and password";
1021 continue;
1022 }
1023 $wgDatabase->initial_setup($conf->RootPW, 'postgres');
1024 }
1025 echo( "<li>Attempting to connect to database \"" . htmlspecialchars( $wgDBname ) .
1026 "\" as \"" . htmlspecialchars( $wgDBuser ) . "\"..." );
1027 $wgDatabase = $dbc->newFromParams($wgDBserver, $wgDBuser, $wgDBpassword, $wgDBname, 1);
1028 if (!$wgDatabase->isOpen()) {
1029 print " error: " . htmlspecialchars( $wgDatabase->lastError() ) . "</li>\n";
1030 } else {
1031 $myver = $wgDatabase->getServerVersion();
1032 }
1033 if (is_callable(array($wgDatabase, 'initial_setup'))) $wgDatabase->initial_setup('', $wgDBname);
1034 }
1035
1036 if ( !$wgDatabase->isOpen() ) {
1037 $errs["DBserver"] = "Couldn't connect to database";
1038 continue;
1039 }
1040
1041 print "<li>Connected to " . htmlspecialchars( "{$conf->DBtype} $myver" );
1042 if ($conf->DBtype == 'mysql') {
1043 if( version_compare( $myver, "4.0.14" ) < 0 ) {
1044 print "</li>\n";
1045 dieout( "-- mysql 4.0.14 or later required. Aborting." );
1046 }
1047 $mysqlNewAuth = version_compare( $myver, "4.1.0", "ge" );
1048 if( $mysqlNewAuth && $mysqlOldClient ) {
1049 print "; <b class='error'>You are using MySQL 4.1 server, but PHP is linked
1050 to old client libraries; if you have trouble with authentication, see
1051 <a href='http://dev.mysql.com/doc/mysql/en/old-client.html'
1052 >http://dev.mysql.com/doc/mysql/en/old-client.html</a> for help.</b>";
1053 }
1054 if( $wgDBmysql5 ) {
1055 if( $mysqlNewAuth ) {
1056 print "; enabling MySQL 4.1/5.0 charset mode";
1057 } else {
1058 print "; <b class='error'>MySQL 4.1/5.0 charset mode enabled,
1059 but older version detected; will likely fail.</b>";
1060 }
1061 }
1062 print "</li>\n";
1063
1064 @$sel = $wgDatabase->selectDB( $wgDBname );
1065 if( $sel ) {
1066 print "<li>Database <tt>" . htmlspecialchars( $wgDBname ) . "</tt> exists</li>\n";
1067 } else {
1068 $err = mysql_errno();
1069 $databaseSafe = htmlspecialchars( $wgDBname );
1070 if( $err == 1102 /* Invalid database name */ ) {
1071 print "<ul><li><strong>{$databaseSafe}</strong> is not a valid database name.</li></ul>";
1072 continue;
1073 } elseif( $err != 1049 /* Database doesn't exist */ ) {
1074 print "<ul><li>Error selecting database <strong>{$databaseSafe}</strong>: {$err} ";
1075 print htmlspecialchars( mysql_error() ) . "</li></ul>";
1076 continue;
1077 }
1078 print "<li>Attempting to create database...</li>";
1079 $res = $wgDatabase->query( "CREATE DATABASE `$wgDBname`" );
1080 if( !$res ) {
1081 print "<li>Couldn't create database <tt>" .
1082 htmlspecialchars( $wgDBname ) .
1083 "</tt>; try with root access or check your username/pass.</li>\n";
1084 $errs["RootPW"] = "<- Enter";
1085 continue;
1086 }
1087 print "<li>Created database <tt>" . htmlspecialchars( $wgDBname ) . "</tt></li>\n";
1088 }
1089 $wgDatabase->selectDB( $wgDBname );
1090 }
1091 else if ($conf->DBtype == 'postgres') {
1092 if( version_compare( $myver, "8.0" ) < 0 ) {
1093 dieout( "<b>Postgres 8.0 or later is required</b>. Aborting." );
1094 }
1095 }
1096
1097 if( $wgDatabase->tableExists( "cur" ) || $wgDatabase->tableExists( "revision" ) ) {
1098 print "<li>There are already MediaWiki tables in this database. Checking if updates are needed...</li>\n";
1099
1100 if ( $conf->DBtype == 'mysql') {
1101 # Determine existing default character set
1102 if ( $wgDatabase->tableExists( "revision" ) ) {
1103 $revision = $wgDatabase->escapeLike( $conf->DBprefix . 'revision' );
1104 $res = $wgDatabase->query( "SHOW TABLE STATUS LIKE '$revision'" );
1105 $row = $wgDatabase->fetchObject( $res );
1106 if ( !$row ) {
1107 echo "<li>SHOW TABLE STATUS query failed!</li>\n";
1108 $existingSchema = false;
1109 $existingEngine = false;
1110 } else {
1111 if ( preg_match( '/^latin1/', $row->Collation ) ) {
1112 $existingSchema = 'mysql4';
1113 } elseif ( preg_match( '/^utf8/', $row->Collation ) ) {
1114 $existingSchema = 'mysql5';
1115 } elseif ( preg_match( '/^binary/', $row->Collation ) ) {
1116 $existingSchema = 'mysql5-binary';
1117 } else {
1118 $existingSchema = false;
1119 echo "<li><strong>Warning:</strong> Unrecognised existing collation</li>\n";
1120 }
1121 if ( isset( $row->Engine ) ) {
1122 $existingEngine = $row->Engine;
1123 } else {
1124 $existingEngine = $row->Type;
1125 }
1126 }
1127 if ( $existingSchema && $existingSchema != $conf->DBschema ) {
1128 $encExisting = htmlspecialchars( $existingSchema );
1129 $encRequested = htmlspecialchars( $conf->DBschema );
1130 print "<li><strong>Warning:</strong> you requested the $encRequested schema, " .
1131 "but the existing database has the $encExisting schema. This upgrade script ".
1132 "can't convert it, so it will remain $encExisting.</li>\n";
1133 $conf->setSchema( $existingSchema, $conf->DBengine );
1134 }
1135 if ( $existingEngine && $existingEngine != $conf->DBengine ) {
1136 $encExisting = htmlspecialchars( $existingEngine );
1137 $encRequested = htmlspecialchars( $conf->DBengine );
1138 print "<li><strong>Warning:</strong> you requested the $encRequested storage " .
1139 "engine, but the existing database uses the $encExisting engine. This upgrade " .
1140 "script can't convert it, so it will remain $encExisting.</li>\n";
1141 $conf->setSchema( $conf->DBschema, $existingEngine );
1142 }
1143 }
1144
1145 # Create user if required
1146 if ( $conf->Root ) {
1147 $conn = $dbc->newFromParams( $wgDBserver, $wgDBuser, $wgDBpassword, $wgDBname, 1 );
1148 if ( $conn->isOpen() ) {
1149 print "<li>DB user account ok</li>\n";
1150 $conn->close();
1151 } else {
1152 print "<li>Granting user permissions...";
1153 if( $mysqlOldClient && $mysqlNewAuth ) {
1154 print " <b class='error'>If the next step fails, see <a href='http://dev.mysql.com/doc/mysql/en/old-client.html'>http://dev.mysql.com/doc/mysql/en/old-client.html</a> for help.</b>";
1155 }
1156 print "</li>\n";
1157 dbsource( "../maintenance/users.sql", $wgDatabase );
1158 }
1159 }
1160 }
1161 print "</ul><pre>\n";
1162 chdir( ".." );
1163 flush();
1164 do_all_updates();
1165 chdir( "config" );
1166 print "</pre>\n";
1167 print "<ul><li>Finished update checks.</li>\n";
1168 } else {
1169 # Determine available storage engines if possible
1170 if ( $conf->DBtype == 'mysql' && version_compare( $myver, "4.1.2", "ge" ) ) {
1171 $res = $wgDatabase->query( 'SHOW ENGINES' );
1172 $found = false;
1173 while ( $row = $wgDatabase->fetchObject( $res ) ) {
1174 if ( $row->Engine == $conf->DBengine ) {
1175 $found = true;
1176 break;
1177 }
1178 }
1179 $wgDatabase->freeResult( $res );
1180 if ( !$found && $conf->DBengine != 'MyISAM' ) {
1181 echo "<li><strong>Warning:</strong> " . htmlspecialchars( $conf->DBengine ) .
1182 " storage engine not available, " .
1183 "using MyISAM instead</li>\n";
1184 $conf->setSchema( $conf->DBschema, 'MyISAM' );
1185 }
1186 }
1187
1188 # FIXME: Check for errors
1189 print "<li>Creating tables...";
1190 if ($conf->DBtype == 'mysql') {
1191 dbsource( "../maintenance/tables.sql", $wgDatabase );
1192 dbsource( "../maintenance/interwiki.sql", $wgDatabase );
1193 } elseif (is_callable(array($wgDatabase, 'setup_database'))) {
1194 $wgDatabase->setup_database();
1195 }
1196 else {
1197 $errs["DBtype"] = "Do not know how to handle database type '$conf->DBtype'";
1198 continue;
1199 }
1200
1201 print " done.</li>\n";
1202
1203 print "<li>Initializing statistics...</li>\n";
1204 $wgDatabase->insert( 'site_stats',
1205 array ( 'ss_row_id' => 1,
1206 'ss_total_views' => 0,
1207 'ss_total_edits' => 1, # Main page first edit
1208 'ss_good_articles' => 0, # Main page is not a good article - no internal link
1209 'ss_total_pages' => 1, # Main page
1210 'ss_users' => $conf->SysopName ? 1 : 0, # Sysop account, if created
1211 'ss_admins' => $conf->SysopName ? 1 : 0, # Sysop account, if created
1212 'ss_images' => 0 ) );
1213
1214 # Set up the "regular user" account *if we can, and if we need to*
1215 if( $conf->Root and $conf->DBtype == 'mysql') {
1216 # See if we need to
1217 $wgDatabase2 = $dbc->newFromParams( $wgDBserver, $wgDBuser, $wgDBpassword, $wgDBname, 1 );
1218 if( $wgDatabase2->isOpen() ) {
1219 # Nope, just close the test connection and continue
1220 $wgDatabase2->close();
1221 echo( "<li>User " . htmlspecialchars( $wgDBuser ) . " exists. Skipping grants.</li>\n" );
1222 } else {
1223 # Yes, so run the grants
1224 echo( "<li>" . htmlspecialchars( "Granting user permissions to $wgDBuser on $wgDBname..." ) );
1225 dbsource( "../maintenance/users.sql", $wgDatabase );
1226 echo( "success.</li>\n" );
1227 }
1228 }
1229
1230 if( $conf->SysopName ) {
1231 $u = User::newFromName( $conf->getSysopName() );
1232 if ( !$u ) {
1233 print "<li><strong class=\"error\">Warning:</strong> Skipped sysop account creation - invalid username!</li>\n";
1234 }
1235 else if ( 0 == $u->idForName() ) {
1236 $u->addToDatabase();
1237 $u->setPassword( $conf->getSysopPass() );
1238 $u->saveSettings();
1239
1240 $u->addGroup( "sysop" );
1241 $u->addGroup( "bureaucrat" );
1242
1243 print "<li>Created sysop account <tt>" .
1244 htmlspecialchars( $conf->SysopName ) . "</tt>.</li>\n";
1245 } else {
1246 print "<li>Could not create user - already exists!</li>\n";
1247 }
1248 } else {
1249 print "<li>Skipped sysop account creation, no name given.</li>\n";
1250 }
1251
1252 $titleobj = Title::newFromText( wfMsgNoDB( "mainpage" ) );
1253 $article = new Article( $titleobj );
1254 $newid = $article->insertOn( $wgDatabase );
1255 $revision = new Revision( array(
1256 'page' => $newid,
1257 'text' => wfMsg( 'mainpagetext' ) . "\n\n" . wfMsgNoTrans( 'mainpagedocfooter' ),
1258 'comment' => '',
1259 'user' => 0,
1260 'user_text' => 'MediaWiki default',
1261 ) );
1262 $revid = $revision->insertOn( $wgDatabase );
1263 $article->updateRevisionOn( $wgDatabase, $revision );
1264 }
1265 // Now that all database work is done, make sure everything is committed
1266 $wgDatabase->commit();
1267
1268 /* Write out the config file now that all is well */
1269 print "<li style=\"list-style: none\">\n";
1270 print "<p>Creating LocalSettings.php...</p>\n\n";
1271 $localSettings = "<" . "?php$endl$local";
1272 // Fix up a common line-ending problem (due to CVS on Windows)
1273 $localSettings = str_replace( "\r\n", "\n", $localSettings );
1274 $f = fopen( "LocalSettings.php", 'xt' );
1275
1276 if( $f == false ) {
1277 print( "</li>\n" );
1278 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" .
1279 "<p>Here's the file that would have been written, try to paste it into place manually:</p>\n" .
1280 "<pre>\n" . htmlspecialchars( $localSettings ) . "</pre>\n" );
1281 }
1282 if(fwrite( $f, $localSettings ) ) {
1283 fclose( $f );
1284 print "<hr/>\n";
1285 writeSuccessMessage();
1286 print "</li>\n";
1287 } else {
1288 fclose( $f );
1289 dieout( "<p class='error'>An error occured while writing the config/LocalSettings.php file. Check user rights and disk space then try again.</p></li>\n" );
1290 }
1291
1292 } while( false );
1293 }
1294
1295 print "</ul>\n";
1296 $mainListOpened = false;
1297
1298 if( count( $errs ) ) {
1299 /* Display options form */
1300
1301 if( $conf->posted ) {
1302 echo "<p class='error-top'>Something's not quite right yet; make sure everything below is filled out correctly.</p>\n";
1303 }
1304 ?>
1305
1306 <form action="<?php echo defined('MW_INSTALL_PHP5_EXT') ? 'index.php5' : 'index.php'; ?>" name="config" method="post">
1307
1308 <h2>Site config</h2>
1309
1310 <div class="config-section">
1311 <div class="config-input">
1312 <?php aField( $conf, "Sitename", "Wiki name:" ); ?>
1313 </div>
1314 <p class="config-desc">
1315 Preferably a short word without punctuation, i.e. "Wikipedia".<br />
1316 Will appear as the namespace name for "meta" pages, and throughout the interface.
1317 </p>
1318 <div class="config-input"><?php aField( $conf, "EmergencyContact", "Contact e-mail:" ); ?></div>
1319 <p class="config-desc">
1320 Displayed to users in some error messages, used as the return address for password reminders, and used as the default sender address of e-mail notifications.
1321 </p>
1322
1323 <div class="config-input">
1324 <label class='column' for="LanguageCode">Language:</label>
1325 <select id="LanguageCode" name="LanguageCode"><?php
1326 $list = getLanguageList();
1327 foreach( $list as $code => $name ) {
1328 $sel = ($code == $conf->LanguageCode) ? 'selected="selected"' : '';
1329 $encCode = htmlspecialchars( $code );
1330 $encName = htmlspecialchars( $name );
1331 echo "\n\t\t<option value=\"$encCode\" $sel>$encName</option>";
1332 }
1333 echo "\n";
1334 ?>
1335 </select>
1336 </div>
1337 <p class="config-desc">
1338 Select the language for your wiki's interface. Some localizations aren't fully complete. Unicode (UTF-8) is used for all localizations.
1339 </p>
1340
1341 <div class="config-input">
1342 <label class='column'>Copyright/license:</label>
1343
1344 <ul class="plain">
1345 <li><?php aField( $conf, "License", "No license metadata", "radio", "none" ); ?></li>
1346 <li><?php aField( $conf, "License", "Public Domain", "radio", "pd" ); ?></li>
1347 <li><?php aField( $conf, "License", "GNU Free Documentation License 1.2 (Wikipedia-compatible)", "radio", "gfdl1_2" ); ?></li>
1348 <li><?php aField( $conf, "License", "GNU Free Documentation License 1.3", "radio", "gfdl1_3" ); ?></li>
1349 <li><?php
1350 aField( $conf, "License", "A Creative Commons license - ", "radio", "cc" );
1351 $partner = "MediaWiki";
1352 $script = defined('MW_INSTALL_PHP5_EXT') ? 'index.php5' : 'index.php';
1353 $exit = urlencode( "$wgServer{$conf->ScriptPath}/config/$script?License=cc&RightsUrl=[license_url]&RightsText=[license_name]&RightsCode=[license_code]&RightsIcon=[license_button]" );
1354 $icon = urlencode( "$wgServer$wgUploadPath/wiki.png" );
1355 $ccApp = htmlspecialchars( "http://creativecommons.org/license/?partner=$partner&exit_url=$exit&partner_icon_url=$icon" );
1356 print "<a href=\"$ccApp\" target='_blank'>choose</a>";
1357 if( $conf->License == "cc" ) { ?>
1358 <ul>
1359 <li><?php aField( $conf, "RightsIcon", "<img src=\"" . htmlspecialchars( $conf->RightsIcon ) . "\" alt='(Creative Commons icon)' />", "hidden" ); ?></li>
1360 <li><?php aField( $conf, "RightsText", htmlspecialchars( $conf->RightsText ), "hidden" ); ?></li>
1361 <li><?php aField( $conf, "RightsCode", "code: " . htmlspecialchars( $conf->RightsCode ), "hidden" ); ?></li>
1362 <li><?php aField( $conf, "RightsUrl", "<a href=\"" . htmlspecialchars( $conf->RightsUrl ) . "\">" . htmlspecialchars( $conf->RightsUrl ) . "</a>", "hidden" ); ?></li>
1363 </ul>
1364 <?php } ?>
1365 </li>
1366 </ul>
1367 </div>
1368 <p class="config-desc">
1369 A notice, icon, and machine-readable copyright metadata will be displayed for the license you pick.
1370 </p>
1371
1372
1373 <div class="config-input">
1374 <?php aField( $conf, "SysopName", "Admin username:" ) ?>
1375 </div>
1376 <div class="config-input">
1377 <?php aField( $conf, "SysopPass", "Password:", "password" ) ?>
1378 </div>
1379 <div class="config-input">
1380 <?php aField( $conf, "SysopPass2", "Password confirm:", "password" ) ?>
1381 </div>
1382 <p class="config-desc">
1383 An admin can lock/delete pages, block users from editing, and do other maintenance tasks.<br />
1384 A new account will be added only when creating a new wiki database.
1385 <br /><br />
1386 The password cannot be the same as the username.
1387 </p>
1388
1389 <div class="config-input">
1390 <label class='column'>Object caching:</label>
1391
1392 <ul class="plain">
1393 <li><?php aField( $conf, "Shm", "No caching", "radio", "none" ); ?></li>
1394 <?php
1395 if ( $conf->turck ) {
1396 echo "<li>";
1397 aField( $conf, "Shm", "Turck MMCache", "radio", "turck" );
1398 echo "</li>\n";
1399 }
1400 if( $conf->xcache ) {
1401 echo "<li>";
1402 aField( $conf, 'Shm', 'XCache', 'radio', 'xcache' );
1403 echo "</li>\n";
1404 }
1405 if ( $conf->apc ) {
1406 echo "<li>";
1407 aField( $conf, "Shm", "APC", "radio", "apc" );
1408 echo "</li>\n";
1409 }
1410 if ( $conf->eaccel ) {
1411 echo "<li>";
1412 aField( $conf, "Shm", "eAccelerator", "radio", "eaccel" );
1413 echo "</li>\n";
1414 }
1415 if ( $conf->dba ) {
1416 echo "<li>";
1417 aField( $conf, "Shm", "DBA (not recommended)", "radio", "dba" );
1418 echo "</li>";
1419 }
1420 ?>
1421 <li><?php aField( $conf, "Shm", "Memcached", "radio", "memcached" ); ?></li>
1422 </ul>
1423 <div style="clear:left"><?php aField( $conf, "MCServers", "Memcached servers:", "text" ) ?></div>
1424 </div>
1425 <p class="config-desc">
1426 An object caching system such as memcached will provide a significant performance boost,
1427 but needs to be installed. Provide the server addresses and ports in a comma-separated list.
1428 <br /><br />
1429 MediaWiki can also detect and support eAccelerator, Turck MMCache, APC, and XCache, but
1430 these should not be used if the wiki will be running on multiple application servers.
1431 <br/><br/>
1432 DBA (Berkeley-style DB) is generally slower than using no cache at all, and is only
1433 recommended for testing.
1434 </p>
1435 </div>
1436
1437 <h2>E-mail, e-mail notification and authentication setup</h2>
1438
1439 <div class="config-section">
1440 <div class="config-input">
1441 <label class='column'>E-mail features (global):</label>
1442 <ul class="plain">
1443 <li><?php aField( $conf, "Email", "Enabled", "radio", "email_enabled" ); ?></li>
1444 <li><?php aField( $conf, "Email", "Disabled", "radio", "email_disabled" ); ?></li>
1445 </ul>
1446 </div>
1447 <p class="config-desc">
1448 Use this to disable all e-mail functions (password reminders, user-to-user e-mail, and e-mail notifications)
1449 if sending mail doesn't work on your server.
1450 </p>
1451
1452 <div class="config-input">
1453 <label class='column'>User-to-user e-mail:</label>
1454 <ul class="plain">
1455 <li><?php aField( $conf, "Emailuser", "Enabled", "radio", "emailuser_enabled" ); ?></li>
1456 <li><?php aField( $conf, "Emailuser", "Disabled", "radio", "emailuser_disabled" ); ?></li>
1457 </ul>
1458 </div>
1459 <p class="config-desc">
1460 The user-to-user e-mail feature (Special:Emailuser) lets the wiki act as a relay to allow users to exchange e-mail without publicly advertising their e-mail address.
1461 </p>
1462 <div class="config-input">
1463 <label class='column'>E-mail notification about changes:</label>
1464 <ul class="plain">
1465 <li><?php aField( $conf, "Enotif", "Disabled", "radio", "enotif_disabled" ); ?></li>
1466 <li><?php aField( $conf, "Enotif", "Enabled for changes to user discussion pages only", "radio", "enotif_usertalk" ); ?></li>
1467 <li><?php aField( $conf, "Enotif", "Enabled for changes to user discussion pages, and to pages on watchlists (not recommended for large wikis)", "radio", "enotif_allpages" ); ?></li>
1468 </ul>
1469 </div>
1470 <div class="config-desc">
1471 <p>
1472 For this feature to work, an e-mail address must be present for the user account, and the notification
1473 options in the user's preferences must be enabled. Also note the
1474 authentication option below. When testing the feature, keep in mind that your own changes will never trigger notifications to be sent to yourself.</p>
1475
1476 <p>There are additional options for fine tuning in /includes/DefaultSettings.php; copy these to your LocalSettings.php and edit them there to change them.</p>
1477 </div>
1478
1479 <div class="config-input">
1480 <label class='column'>E-mail address authentication:</label>
1481 <ul class="plain">
1482 <li><?php aField( $conf, "Eauthent", "Disabled", "radio", "eauthent_disabled" ); ?></li>
1483 <li><?php aField( $conf, "Eauthent", "Enabled", "radio", "eauthent_enabled" ); ?></li>
1484 </ul>
1485 </div>
1486 <div class="config-desc">
1487 <p>If this option is enabled, users have to confirm their e-mail address using a magic link sent to them whenever they set or change it, and only authenticated e-mail addresses can receive mails from other users and/or
1488 change notification mails. Setting this option is <b>recommended</b> for public wikis because of potential abuse of the e-mail features above.</p>
1489 </div>
1490
1491 </div>
1492
1493 <h2>Database config</h2>
1494
1495 <div class="config-section">
1496 <div class="config-input">
1497 <label class='column'>Database type:</label>
1498 <?php
1499 if (isset($errs['DBpicktype'])) {
1500 print "\t<span class='error'>" . htmlspecialchars( $errs['DBpicktype'] ) . "</span>\n";
1501 }
1502 ?>
1503 <ul class='plain'><?php
1504 database_picker($conf);
1505 ?></ul>
1506 </div>
1507
1508 <div class="config-input" style="clear:left">
1509 <?php aField( $conf, "DBserver", "Database host:" ); ?>
1510 </div>
1511 <p class="config-desc">
1512 If your database server isn't on your web server, enter the name or IP address here.
1513 </p>
1514
1515 <div class="config-input"><?php aField( $conf, "DBname", "Database name:" ); ?></div>
1516 <div class="config-input"><?php aField( $conf, "DBuser", "DB username:" ); ?></div>
1517 <div class="config-input"><?php aField( $conf, "DBpassword", "DB password:", "password" ); ?></div>
1518 <div class="config-input"><?php aField( $conf, "DBpassword2", "DB password confirm:", "password" ); ?></div>
1519 <p class="config-desc">
1520 If you only have a single user account and database available,
1521 enter those here. If you have database root access (see below)
1522 you can specify new accounts/databases to be created. This account
1523 will not be created if it pre-exists. If this is the case, ensure that it
1524 has SELECT, INSERT, UPDATE, and DELETE permissions on the MediaWiki database.
1525 </p>
1526
1527 <div class="config-input">
1528 <label class="column">Superuser account:</label>
1529 <input type="checkbox" name="useroot" id="useroot" <?php if( $useRoot ) { ?>checked="checked" <?php } ?> />
1530 &nbsp;<label for="useroot">Use superuser account</label>
1531 <input type="checkbox" name="populateadmin" id="populateadmin" <?php if( $conf->populateadmin ) { ?>checked="checked" <?php } ?> />
1532 &nbsp;<label for="populateadmin">Set as admin user for maintenance</label>
1533 </div>
1534 <div class="config-input"><?php aField( $conf, "RootUser", "Superuser name:", "text" ); ?></div>
1535 <div class="config-input"><?php aField( $conf, "RootPW", "Superuser password:", "password" ); ?></div>
1536
1537 <p class="config-desc">
1538 If the database user specified above does not exist, or does not have access to create
1539 the database (if needed) or tables within it, please check the box and provide details
1540 of a superuser account, such as <strong>root</strong>, which does.
1541 </p>
1542
1543 <?php database_switcher('mysql'); ?>
1544 <div class="config-input"><?php aField( $conf, "DBprefix", "Database table prefix:" ); ?></div>
1545 <div class="config-desc">
1546 <p>If you need to share one database between multiple wikis, or
1547 between MediaWiki and another web application, you may choose to
1548 add a prefix to all the table names to avoid conflicts.</p>
1549
1550 <p>Avoid exotic characters; something like <tt>mw_</tt> is good.</p>
1551 </div>
1552
1553 <div class="config-input"><label class="column">Storage Engine</label>
1554 <div>Select one:</div>
1555 <ul class="plain">
1556 <li><?php aField( $conf, "DBengine", "InnoDB", "radio", "InnoDB" ); ?></li>
1557 <li><?php aField( $conf, "DBengine", "MyISAM", "radio", "MyISAM" ); ?></li>
1558 </ul>
1559 </div>
1560 <p class="config-desc">
1561 InnoDB is best for public web installations, since it has good concurrency
1562 support. MyISAM may be faster in single-user installations. MyISAM databases
1563 tend to get corrupted more often than InnoDB databases.
1564 </p>
1565 <div class="config-input"><label class="column">Database character set</label>
1566 <div>Select one:</div>
1567 <ul class="plain">
1568 <li><?php aField( $conf, "DBschema", "MySQL 4.1/5.0 binary", "radio", "mysql5-binary" ); ?></li>
1569 <li><?php aField( $conf, "DBschema", "MySQL 4.1/5.0 UTF-8", "radio", "mysql5" ); ?></li>
1570 <li><?php aField( $conf, "DBschema", "MySQL 4.0 backwards-compatible UTF-8", "radio", "mysql4" ); ?></li>
1571 </ul>
1572 </div>
1573 <p class="config-desc">
1574 This option is ignored on upgrade, the same character set will be kept.
1575 <br/><br/>
1576 <b>WARNING:</b> If you use <b>backwards-compatible UTF-8</b> on MySQL 4.1+, and subsequently back up the database with <tt>mysqldump</tt>, it may destroy all non-ASCII characters, irreversibly corrupting your backups!.
1577 <br/><br/>
1578 In <b>binary mode</b>, MediaWiki stores UTF-8 text to the database in binary fields. This is more efficient than MySQL's UTF-8 mode, and allows you to use the full range of Unicode characters. In <b>UTF-8 mode</b>, MySQL will know what character set your data is in, and can present and convert it appropriately, but it won't let you store characters above the <a target="_blank" href="http://en.wikipedia.org/wiki/Mapping_of_Unicode_character_planes">Basic Multilingual Plane</a>.
1579 </p>
1580 </fieldset>
1581
1582 <?php database_switcher('postgres'); ?>
1583 <div class="config-input"><?php aField( $conf, "DBport", "Database port:" ); ?></div>
1584 <div class="config-input"><?php aField( $conf, "DBmwschema", "Schema for mediawiki:" ); ?></div>
1585 <div class="config-input"><?php aField( $conf, "DBts2schema", "Schema for tsearch2:" ); ?></div>
1586 <div class="config-desc">
1587 <p>The username specified above (at "DB username") will have its search path set to the above schemas,
1588 so it is recommended that you create a new user. The above schemas are generally correct:
1589 only change them if you are sure you need to.</p>
1590 </div>
1591 </fieldset>
1592
1593 <?php database_switcher('sqlite'); ?>
1594 <div class="config-desc">
1595 <b>NOTE:</b> SQLite only uses the <i>Database name</i> setting above, the user, password and root settings are ignored.
1596 </div>
1597 <div class="config-input"><?php
1598 aField( $conf, "SQLiteDataDir", "SQLite data directory:" );
1599 ?></div>
1600 <div class="config-desc">
1601 <p>SQLite stores table data into files in the filesystem.
1602 If you do not provide an explicit path, a "data" directory in
1603 the parent of your document root will be used.</p>
1604
1605 <p>This directory must exist and be writable by the web server.</p>
1606 </div>
1607 </fieldset>
1608
1609 <?php database_switcher('mssql'); ?>
1610 <div class="config-input"><?php
1611 aField( $conf, "DBprefix2", "Database table prefix:" );
1612 ?></div>
1613 <div class="config-desc">
1614 <p>If you need to share one database between multiple wikis, or
1615 between MediaWiki and another web application, you may choose to
1616 add a prefix to all the table names to avoid conflicts.</p>
1617
1618 <p>Avoid exotic characters; something like <tt>mw_</tt> is good.</p>
1619 </div>
1620 </fieldset>
1621
1622 <?php database_switcher('ibm_db2'); ?>
1623 <div class="config-input"><?php
1624 aField( $conf, "DBport_db2", "Database port:" );
1625 ?></div>
1626 <div class="config-input"><?php
1627 aField( $conf, "DBmwschema", "Schema for mediawiki:" );
1628 ?></div>
1629 <div>Select one:</div>
1630 <ul class="plain">
1631 <li><?php aField( $conf, "DBcataloged", "Cataloged (DB2 installed locally)", "radio", "cataloged" ); ?></li>
1632 <li><?php aField( $conf, "DBcataloged", "Uncataloged (remote DB2 through ODBC)", "radio", "uncataloged" ); ?></li>
1633 </ul>
1634 <div class="config-desc">
1635 <p>If you need to share one database between multiple wikis, or
1636 between MediaWiki and another web application, you may specify
1637 a different schema to avoid conflicts.</p>
1638 </div>
1639 </fieldset>
1640
1641 <?php database_switcher('oracle'); ?>
1642 <div class="config-input"><?php aField( $conf, "DBprefix_ora", "Database table prefix:" ); ?></div>
1643 <div class="config-desc">
1644 <p>If you need to share one database between multiple wikis, or
1645 between MediaWiki and another web application, you may choose to
1646 add a prefix to all the table names to avoid conflicts.</p>
1647
1648 <p>Avoid exotic characters; something like <tt>mw_</tt> is good.</p>
1649 </div>
1650 <div class="config-input"><?php aField( $conf, "DBdefTS_ora", "Default tablespace:" ); ?></div>
1651 <div class="config-input"><?php aField( $conf, "DBtempTS_ora", "Temporary tablespace:" ); ?></div>
1652 </fieldset>
1653
1654 <div class="config-input" style="padding:2em 0 3em">
1655 <label class='column'>&nbsp;</label>
1656 <input type="submit" value="Install MediaWiki!" class="btn-install" />
1657 </div>
1658 </div>
1659 </form>
1660 <script type="text/javascript">
1661 window.onload = toggleDBarea( <?php echo Xml::encodeJsVar( $conf->DBtype ); ?>,
1662 <?php
1663 ## If they passed in a root user name, don't populate it on page load
1664 echo strlen(importPost('RootUser', '')) ? 0 : 1;
1665 ?>);
1666 </script>
1667 <?php
1668 }
1669
1670 /* -------------------------------------------------------------------------------------- */
1671 function writeSuccessMessage() {
1672 $script = defined('MW_INSTALL_PHP5_EXT') ? 'index.php5' : 'index.php';
1673 if ( wfIniGetBool( 'safe_mode' ) && !ini_get( 'open_basedir' ) ) {
1674 echo <<<EOT
1675 <div class="success-box">
1676 <p>Installation successful!</p>
1677 <p>To complete the installation, please do the following:
1678 <ol>
1679 <li>Download config/LocalSettings.php with your FTP client or file manager</li>
1680 <li>Upload it to the parent directory</li>
1681 <li>Delete config/LocalSettings.php</li>
1682 <li>Start using <a href='../$script'>your wiki</a>!
1683 </ol>
1684 <p>If you are in a shared hosting environment, do <strong>not</strong> just move LocalSettings.php
1685 remotely. LocalSettings.php is currently owned by the user your webserver is running under,
1686 which means that anyone on the same server can read your database password! Downloading
1687 it and uploading it again will hopefully change the ownership to a user ID specific to you.</p>
1688 </div>
1689 EOT;
1690 } else {
1691 echo <<<EOT
1692 <div class="success-box">
1693 <p>
1694 <span class="success-message">Installation successful!</span>
1695 Move the <tt>config/LocalSettings.php</tt> file to the parent directory, then follow
1696 <a href="../$script"> this link</a> to your wiki.</p>
1697 <p>You should change file permissions for <tt>LocalSettings.php</tt> as required to
1698 prevent other users on the server reading passwords and altering configuration data.</p>
1699 </div>
1700 EOT;
1701 }
1702 }
1703
1704
1705 function escapePhpString( $string ) {
1706 if ( is_array( $string ) || is_object( $string ) ) {
1707 return false;
1708 }
1709 return strtr( $string,
1710 array(
1711 "\n" => "\\n",
1712 "\r" => "\\r",
1713 "\t" => "\\t",
1714 "\\" => "\\\\",
1715 "\$" => "\\\$",
1716 "\"" => "\\\""
1717 ));
1718 }
1719
1720 function writeLocalSettings( $conf ) {
1721 $conf->PasswordSender = $conf->EmergencyContact;
1722 $magic = ($conf->ImageMagick ? "" : "# ");
1723 $convert = ($conf->ImageMagick ? $conf->ImageMagick : "/usr/bin/convert" );
1724 $rights = ($conf->RightsUrl) ? "" : "# ";
1725 $hashedUploads = $conf->safeMode ? '' : '# ';
1726
1727 if ( $conf->ShellLocale ) {
1728 $locale = '';
1729 } else {
1730 $locale = '# ';
1731 $conf->ShellLocale = 'en_US.UTF-8';
1732 }
1733
1734 switch ( $conf->Shm ) {
1735 case 'memcached':
1736 $cacheType = 'CACHE_MEMCACHED';
1737 $mcservers = var_export( $conf->MCServerArray, true );
1738 break;
1739 case 'turck':
1740 case 'xcache':
1741 case 'apc':
1742 case 'eaccel':
1743 $cacheType = 'CACHE_ACCEL';
1744 $mcservers = 'array()';
1745 break;
1746 case 'dba':
1747 $cacheType = 'CACHE_DBA';
1748 $mcservers = 'array()';
1749 break;
1750 default:
1751 $cacheType = 'CACHE_NONE';
1752 $mcservers = 'array()';
1753 }
1754
1755 if ( $conf->Email == 'email_enabled' ) {
1756 $enableemail = 'true';
1757 $enableuseremail = ( $conf->Emailuser == 'emailuser_enabled' ) ? 'true' : 'false' ;
1758 $eauthent = ( $conf->Eauthent == 'eauthent_enabled' ) ? 'true' : 'false' ;
1759 switch ( $conf->Enotif ) {
1760 case 'enotif_usertalk':
1761 $enotifusertalk = 'true';
1762 $enotifwatchlist = 'false';
1763 break;
1764 case 'enotif_allpages':
1765 $enotifusertalk = 'true';
1766 $enotifwatchlist = 'true';
1767 break;
1768 default:
1769 $enotifusertalk = 'false';
1770 $enotifwatchlist = 'false';
1771 }
1772 } else {
1773 $enableuseremail = 'false';
1774 $enableemail = 'false';
1775 $eauthent = 'false';
1776 $enotifusertalk = 'false';
1777 $enotifwatchlist = 'false';
1778 }
1779
1780 $file = @fopen( "/dev/urandom", "r" );
1781 if ( $file ) {
1782 $secretKey = bin2hex( fread( $file, 32 ) );
1783 fclose( $file );
1784 } else {
1785 $secretKey = "";
1786 for ( $i=0; $i<8; $i++ ) {
1787 $secretKey .= dechex(mt_rand(0, 0x7fffffff));
1788 }
1789 print "<li>Warning: \$wgSecretKey key is insecure, generated with mt_rand(). Consider changing it manually.</li>\n";
1790 }
1791
1792 # Add slashes to strings for double quoting
1793 $slconf = wfArrayMap( "escapePhpString", get_object_vars( $conf ) );
1794 if( $conf->License == 'gfdl1_2' || $conf->License == 'pd' || $conf->License == 'gfdl1_3' ) {
1795 # Needs literal string interpolation for the current style path
1796 $slconf['RightsIcon'] = $conf->RightsIcon;
1797 }
1798
1799 if( $conf->populateadmin ) {
1800 $slconf['DBadminuser'] = $conf->RootUser;
1801 $slconf['DBadminpassword'] = $conf->RootPW;
1802 }
1803
1804 if( $conf->DBtype == 'mysql' ) {
1805 $dbsettings =
1806 "# MySQL specific settings
1807 \$wgDBprefix = \"{$slconf['DBprefix']}\";
1808
1809 # MySQL table options to use during installation or update
1810 \$wgDBTableOptions = \"{$slconf['DBTableOptions']}\";
1811
1812 # Experimental charset support for MySQL 4.1/5.0.
1813 \$wgDBmysql5 = {$conf->DBmysql5};";
1814 } elseif( $conf->DBtype == 'postgres' ) {
1815 $dbsettings =
1816 "# Postgres specific settings
1817 \$wgDBport = \"{$slconf['DBport']}\";
1818 \$wgDBmwschema = \"{$slconf['DBmwschema']}\";
1819 \$wgDBts2schema = \"{$slconf['DBts2schema']}\";";
1820 } elseif( $conf->DBtype == 'sqlite' ) {
1821 $dbsettings =
1822 "# SQLite-specific settings
1823 \$wgSQLiteDataDir = \"{$slconf['SQLiteDataDir']}\";";
1824 } elseif( $conf->DBtype == 'mssql' ) {
1825 $dbsettings =
1826 "# MSSQL specific settings
1827 \$wgDBprefix = \"{$slconf['DBprefix2']}\";";
1828 } elseif( $conf->DBtype == 'ibm_db2' ) {
1829 $dbsettings =
1830 "# DB2 specific settings
1831 \$wgDBport_db2 = \"{$slconf['DBport_db2']}\";
1832 \$wgDBmwschema = \"{$slconf['DBmwschema']}\";
1833 \$wgDBcataloged = \"{$slconf['DBcataloged']}\";";
1834 } elseif( $conf->DBtype == 'oracle' ) {
1835 $dbsettings =
1836 "# Oracle specific settings
1837 \$wgDBprefix = \"{$slconf['DBprefix']}\";";
1838 } else {
1839 // ummm... :D
1840 $dbsettings = '';
1841 }
1842
1843
1844 $localsettings = "
1845 # This file was automatically generated by the MediaWiki installer.
1846 # If you make manual changes, please keep track in case you need to
1847 # recreate them later.
1848 #
1849 # See includes/DefaultSettings.php for all configurable settings
1850 # and their default values, but don't forget to make changes in _this_
1851 # file, not there.
1852 #
1853 # Further documentation for configuration settings may be found at:
1854 # http://www.mediawiki.org/wiki/Manual:Configuration_settings
1855
1856 # If you customize your file layout, set \$IP to the directory that contains
1857 # the other MediaWiki files. It will be used as a base to locate files.
1858 if( defined( 'MW_INSTALL_PATH' ) ) {
1859 \$IP = MW_INSTALL_PATH;
1860 } else {
1861 \$IP = dirname( __FILE__ );
1862 }
1863
1864 \$path = array( \$IP, \"\$IP/includes\", \"\$IP/languages\" );
1865 set_include_path( implode( PATH_SEPARATOR, \$path ) . PATH_SEPARATOR . get_include_path() );
1866
1867 require_once( \"\$IP/includes/DefaultSettings.php\" );
1868
1869 # If PHP's memory limit is very low, some operations may fail.
1870 " . ($conf->raiseMemory ? '' : '# ' ) . "ini_set( 'memory_limit', '20M' );" . "
1871
1872 if ( \$wgCommandLineMode ) {
1873 if ( isset( \$_SERVER ) && array_key_exists( 'REQUEST_METHOD', \$_SERVER ) ) {
1874 die( \"This script must be run from the command line\\n\" );
1875 }
1876 }
1877 ## Uncomment this to disable output compression
1878 # \$wgDisableOutputCompression = true;
1879
1880 \$wgSitename = \"{$slconf['Sitename']}\";
1881
1882 ## The URL base path to the directory containing the wiki;
1883 ## defaults for all runtime URL paths are based off of this.
1884 ## For more information on customizing the URLs please see:
1885 ## http://www.mediawiki.org/wiki/Manual:Short_URL
1886 \$wgScriptPath = \"{$slconf['ScriptPath']}\";
1887 \$wgScriptExtension = \"{$slconf['ScriptExtension']}\";
1888
1889 ## UPO means: this is also a user preference option
1890
1891 \$wgEnableEmail = $enableemail;
1892 \$wgEnableUserEmail = $enableuseremail; # UPO
1893
1894 \$wgEmergencyContact = \"{$slconf['EmergencyContact']}\";
1895 \$wgPasswordSender = \"{$slconf['PasswordSender']}\";
1896
1897 \$wgEnotifUserTalk = $enotifusertalk; # UPO
1898 \$wgEnotifWatchlist = $enotifwatchlist; # UPO
1899 \$wgEmailAuthentication = $eauthent;
1900
1901 ## Database settings
1902 \$wgDBtype = \"{$slconf['DBtype']}\";
1903 \$wgDBserver = \"{$slconf['DBserver']}\";
1904 \$wgDBname = \"{$slconf['DBname']}\";
1905 \$wgDBuser = \"{$slconf['DBuser']}\";
1906 \$wgDBpassword = \"{$slconf['DBpassword']}\";
1907
1908 {$dbsettings}
1909
1910 ## Database admin settings, used for maintenance scripts
1911 \$wgDBadminuser = \"{$slconf['DBadminuser']}\";
1912 \$wgDBadminpassword = \"{$slconf['DBadminpassword']}\";
1913
1914 ## Shared memory settings
1915 \$wgMainCacheType = $cacheType;
1916 \$wgMemCachedServers = $mcservers;
1917
1918 ## To enable image uploads, make sure the 'images' directory
1919 ## is writable, then set this to true:
1920 \$wgEnableUploads = false;
1921 {$magic}\$wgUseImageMagick = true;
1922 {$magic}\$wgImageMagickConvertCommand = \"{$convert}\";
1923
1924 ## If you use ImageMagick (or any other shell command) on a
1925 ## Linux server, this will need to be set to the name of an
1926 ## available UTF-8 locale
1927 {$locale}\$wgShellLocale = \"{$slconf['ShellLocale']}\";
1928
1929 ## If you want to use image uploads under safe mode,
1930 ## create the directories images/archive, images/thumb and
1931 ## images/temp, and make them all writable. Then uncomment
1932 ## this, if it's not already uncommented:
1933 {$hashedUploads}\$wgHashedUploadDirectory = false;
1934
1935 ## If you have the appropriate support software installed
1936 ## you can enable inline LaTeX equations:
1937 \$wgUseTeX = false;
1938
1939 \$wgLocalInterwiki = strtolower( \$wgSitename );
1940
1941 \$wgLanguageCode = \"{$slconf['LanguageCode']}\";
1942
1943 \$wgSecretKey = \"$secretKey\";
1944
1945 ## Default skin: you can change the default skin. Use the internal symbolic
1946 ## names, ie 'standard', 'nostalgia', 'cologneblue', 'monobook':
1947 \$wgDefaultSkin = 'monobook';
1948
1949 ## For attaching licensing metadata to pages, and displaying an
1950 ## appropriate copyright notice / icon. GNU Free Documentation
1951 ## License and Creative Commons licenses are supported so far.
1952 {$rights}\$wgEnableCreativeCommonsRdf = true;
1953 \$wgRightsPage = \"\"; # Set to the title of a wiki page that describes your license/copyright
1954 \$wgRightsUrl = \"{$slconf['RightsUrl']}\";
1955 \$wgRightsText = \"{$slconf['RightsText']}\";
1956 \$wgRightsIcon = \"{$slconf['RightsIcon']}\";
1957 # \$wgRightsCode = \"{$slconf['RightsCode']}\"; # Not yet used
1958
1959 \$wgDiff3 = \"{$slconf['diff3']}\";
1960
1961 # When you make changes to this configuration file, this will make
1962 # sure that cached pages are cleared.
1963 \$wgCacheEpoch = max( \$wgCacheEpoch, gmdate( 'YmdHis', @filemtime( __FILE__ ) ) );
1964 "; ## End of setting the $localsettings string
1965
1966 // Keep things in Unix line endings internally;
1967 // the system will write out as local text type.
1968 return str_replace( "\r\n", "\n", $localsettings );
1969 }
1970
1971 function dieout( $text ) {
1972 global $mainListOpened;
1973 if( $mainListOpened ) echo( "</ul>" );
1974 if( $text != '' && substr( $text, 0, 2 ) != '<p' && substr( $text, 0, 2 ) != '<h' ){
1975 echo "<p>$text</p>\n";
1976 } else {
1977 echo $text;
1978 }
1979 die( "\n\n</div>\n</div>\n</div>\n</div>\n</body>\n</html>" );
1980 }
1981
1982 function importVar( &$var, $name, $default = "" ) {
1983 if( isset( $var[$name] ) ) {
1984 $retval = $var[$name];
1985 if ( get_magic_quotes_gpc() ) {
1986 $retval = stripslashes( $retval );
1987 }
1988 } else {
1989 $retval = $default;
1990 }
1991 taint( $retval );
1992 return $retval;
1993 }
1994
1995 function importPost( $name, $default = "" ) {
1996 return importVar( $_POST, $name, $default );
1997 }
1998
1999 function importCheck( $name ) {
2000 return isset( $_POST[$name] );
2001 }
2002
2003 function importRequest( $name, $default = "" ) {
2004 return importVar( $_REQUEST, $name, $default );
2005 }
2006
2007 function aField( &$conf, $field, $text, $type = "text", $value = "", $onclick = '' ) {
2008 static $radioCount = 0;
2009 if( $type != "" ) {
2010 $xtype = "type=\"$type\"";
2011 } else {
2012 $xtype = "";
2013 }
2014
2015 $id = $field;
2016 $nolabel = ($type == "radio") || ($type == "hidden");
2017
2018 if ($type == 'radio')
2019 $id .= $radioCount++;
2020
2021 if( !$nolabel ) {
2022 echo "<label class='column' for=\"$id\">$text</label>";
2023 }
2024
2025 if( $type == "radio" && $value == $conf->$field ) {
2026 $checked = "checked='checked'";
2027 } else {
2028 $checked = "";
2029 }
2030 echo "<input $xtype name=\"$field\" id=\"$id\" class=\"iput-$type\" $checked ";
2031 if ($onclick) {
2032 echo " onclick='toggleDBarea(\"$value\",1)' " ;
2033 }
2034 echo "value=\"";
2035 if( $type == "radio" ) {
2036 echo htmlspecialchars( $value );
2037 } else {
2038 echo htmlspecialchars( $conf->$field );
2039 }
2040
2041
2042 echo "\" />";
2043 if( $nolabel ) {
2044 echo "<label for=\"$id\">$text</label>";
2045 }
2046
2047 global $errs;
2048 if(isset($errs[$field])) {
2049 echo "<span class='error'>" . htmlspecialchars( $errs[$field] ) . "</span>\n";
2050 }
2051 }
2052
2053 function getLanguageList() {
2054 global $wgLanguageNames, $IP;
2055 if( !isset( $wgLanguageNames ) ) {
2056 require_once( "$IP/languages/Names.php" );
2057 }
2058
2059 $codes = array();
2060
2061 $d = opendir( "../languages/messages" );
2062 /* In case we are called from the root directory */
2063 if (!$d)
2064 $d = opendir( "languages/messages");
2065 while( false !== ($f = readdir( $d ) ) ) {
2066 $m = array();
2067 if( preg_match( '/Messages([A-Z][a-z_]+)\.php$/', $f, $m ) ) {
2068 $code = str_replace( '_', '-', strtolower( $m[1] ) );
2069 if( isset( $wgLanguageNames[$code] ) ) {
2070 $name = $code . ' - ' . $wgLanguageNames[$code];
2071 } else {
2072 $name = $code;
2073 }
2074 $codes[$code] = $name;
2075 }
2076 }
2077 closedir( $d );
2078 ksort( $codes );
2079 return $codes;
2080 }
2081
2082 #Check for location of an executable
2083 # @param string $loc single location to check
2084 # @param array $names filenames to check for.
2085 # @param mixed $versioninfo array of details to use when checking version, use false for no version checking
2086 function locate_executable($loc, $names, $versioninfo = false) {
2087 if (!is_array($names))
2088 $names = array($names);
2089
2090 foreach ($names as $name) {
2091 $command = "$loc".DIRECTORY_SEPARATOR."$name";
2092 if (@file_exists($command)) {
2093 if (!$versioninfo)
2094 return $command;
2095
2096 $file = str_replace('$1', $command, $versioninfo[0]);
2097 if (strstr(`$file`, $versioninfo[1]) !== false)
2098 return $command;
2099 }
2100 }
2101 return false;
2102 }
2103
2104 # Test a memcached server
2105 function testMemcachedServer( $server ) {
2106 $hostport = explode(":", $server);
2107 $errstr = false;
2108 $fp = false;
2109 if ( !function_exists( 'fsockopen' ) ) {
2110 $errstr = "Can't connect to memcached, fsockopen() not present";
2111 }
2112 if ( !$errstr && count( $hostport ) != 2 ) {
2113 $errstr = 'Please specify host and port';
2114 }
2115 if ( !$errstr ) {
2116 list( $host, $port ) = $hostport;
2117 $errno = 0;
2118 $fsockerr = '';
2119
2120 $fp = @fsockopen( $host, $port, $errno, $fsockerr, 1.0 );
2121 if ( $fp === false ) {
2122 $errstr = "Cannot connect to memcached on $host:$port : $fsockerr";
2123 }
2124 }
2125 if ( !$errstr ) {
2126 $command = "version\r\n";
2127 $bytes = fwrite( $fp, $command );
2128 if ( $bytes != strlen( $command ) ) {
2129 $errstr = "Cannot write to memcached socket on $host:$port";
2130 }
2131 }
2132 if ( !$errstr ) {
2133 $expected = "VERSION ";
2134 $response = fread( $fp, strlen( $expected ) );
2135 if ( $response != $expected ) {
2136 $errstr = "Didn't get correct memcached response from $host:$port";
2137 }
2138 }
2139 if ( $fp ) {
2140 fclose( $fp );
2141 }
2142 if ( !$errstr ) {
2143 echo "<li>Connected to memcached on " . htmlspecialchars( "$host:$port" ) ." successfully</li>";
2144 }
2145 return $errstr;
2146 }
2147
2148 function database_picker($conf) {
2149 global $ourdb;
2150 print "\n";
2151 foreach(array_keys($ourdb) as $db) {
2152 if ($ourdb[$db]['havedriver']) {
2153 print "\t<li>";
2154 aField( $conf, "DBtype", $ourdb[$db]['fullname'], 'radio', $db, 'onclick');
2155 print "</li>\n";
2156 }
2157 }
2158 print "\n\t";
2159 }
2160
2161 function database_switcher($db) {
2162 global $ourdb;
2163 $color = $ourdb[$db]['bgcolor'];
2164 $full = $ourdb[$db]['fullname'];
2165 print "<fieldset id='$db'><legend>$full specific options</legend>\n";
2166 }
2167
2168 function printListItem( $item ) {
2169 print "<li>$item</li>";
2170 }
2171
2172 # Determine a suitable value for $wgShellLocale
2173 function getShellLocale( $wikiLang ) {
2174 # Give up now if we're in safe mode or open_basedir
2175 # It's theoretically possible but tricky to work with
2176 if ( wfIniGetBool( "safe_mode" ) || ini_get( 'open_basedir' ) ) {
2177 return false;
2178 }
2179
2180 $os = php_uname( 's' );
2181 $supported = array( 'Linux', 'SunOS', 'HP-UX' ); # Tested these
2182 if ( !in_array( $os, $supported ) ) {
2183 return false;
2184 }
2185
2186 # Get a list of available locales
2187 $lines = $ret = false;
2188 exec( '/usr/bin/locale -a', $lines, $ret );
2189 if ( $ret ) {
2190 return false;
2191 }
2192
2193 $lines = wfArrayMap( 'trim', $lines );
2194 $candidatesByLocale = array();
2195 $candidatesByLang = array();
2196 foreach ( $lines as $line ) {
2197 if ( $line === '' ) {
2198 continue;
2199 }
2200 if ( !preg_match( '/^([a-zA-Z]+)(_[a-zA-Z]+|)\.(utf8|UTF-8)(@[a-zA-Z_]*|)$/i', $line, $m ) ) {
2201 continue;
2202 }
2203 list( $all, $lang, $territory, $charset, $modifier ) = $m;
2204 $candidatesByLocale[$m[0]] = $m;
2205 $candidatesByLang[$lang][] = $m;
2206 }
2207
2208 # Try the current value of LANG
2209 if ( isset( $candidatesByLocale[ getenv( 'LANG' ) ] ) ) {
2210 return getenv( 'LANG' );
2211 }
2212
2213 # Try the most common ones
2214 $commonLocales = array( 'en_US.UTF-8', 'en_US.utf8', 'de_DE.UTF-8', 'de_DE.utf8' );
2215 foreach ( $commonLocales as $commonLocale ) {
2216 if ( isset( $candidatesByLocale[$commonLocale] ) ) {
2217 return $commonLocale;
2218 }
2219 }
2220
2221 # Is there an available locale in the Wiki's language?
2222 if ( isset( $candidatesByLang[$wikiLang] ) ) {
2223 $m = reset( $candidatesByLang[$wikiLang] );
2224 return $m[0];
2225 }
2226
2227 # Are there any at all?
2228 if ( count( $candidatesByLocale ) ) {
2229 $m = reset( $candidatesByLocale );
2230 return $m[0];
2231 }
2232
2233 # Give up
2234 return false;
2235 }
2236
2237 function wfArrayMap( $function, $input ) {
2238 $ret = array_map( $function, $input );
2239 foreach ( $ret as $key => $value ) {
2240 $taint = istainted( $input[$key] );
2241 if ( $taint ) {
2242 taint( $ret[$key], $taint );
2243 }
2244 }
2245 return $ret;
2246 }
2247
2248 ?>
2249
2250 <div class="license">
2251 <hr/>
2252 <p>This program is free software; you can redistribute it and/or modify
2253 it under the terms of the GNU General Public License as published by
2254 the Free Software Foundation; either version 2 of the License, or
2255 (at your option) any later version.</p>
2256
2257 <p>This program is distributed in the hope that it will be useful,
2258 but WITHOUT ANY WARRANTY; without even the implied warranty of
2259 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2260 GNU General Public License for more details.</p>
2261
2262 <p>You should have received <a href="../COPYING">a copy of the GNU General Public License</a>
2263 along with this program; if not, write to the Free Software
2264 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
2265 or <a href="http://www.gnu.org/copyleft/gpl.html">read it online</a></p>
2266 </div>
2267
2268 </div></div></div>
2269
2270
2271 <div id="column-one">
2272 <div class="portlet" id="p-logo">
2273 <a style="background-image: url(../skins/common/images/mediawiki.png);"
2274 href="../"
2275 title="Main Page"></a>
2276 </div>
2277 <script type="text/javascript"> if (window.isMSIE55) fixalpha(); </script>
2278 <div class='portlet'><div class='pBody'>
2279 <ul>
2280 <li><a href="../README">Readme</a></li>
2281 <li><a href="../RELEASE-NOTES">Release notes</a></li>
2282 <li><a href="../docs/">Documentation</a></li>
2283 <li><a href="http://www.mediawiki.org/wiki/Help:Contents">User's Guide</a></li>
2284 <li><a href="http://www.mediawiki.org/wiki/Manual:Contents">Administrator's Guide</a></li>
2285 <li><a href="http://www.mediawiki.org/wiki/Manual:FAQ">FAQ</a></li>
2286 </ul>
2287 <p style="font-size:90%;margin-top:1em">MediaWiki is Copyright © 2001-2009 by Magnus Manske, Brion Vibber,
2288 Lee Daniel Crocker, Tim Starling, Erik Möller, Gabriel Wicke, Ævar Arnfjörð Bjarmason, Niklas Laxström,
2289 Domas Mituzas, Rob Church, Yuri Astrakhan, Aryeh Gregor, Aaron Schulz and others.</p>
2290 </div></div>
2291 </div>
2292
2293 </div>
2294
2295 </body>
2296 </html>