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