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