# http://www.mediawiki.org/ # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # http://www.gnu.org/copyleft/gpl.html header( "Content-type: text/html; charset=utf-8" ); ?>
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This progarm is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. or read it online
Already configured... return to the wiki.
(You should probably remove this directory for added security.)
" ); } if( file_exists( "./LocalSettings.php" ) || file_exists( "./AdminSettings.php" ) ) { dieout( "Please move LocalSettings.php to the parent directory, then try out your wiki. (You should remove this config directory for added security once you're done.)
" ); } include( "../install-utils.inc" ); class ConfigData { function getEncoded( $data ) { # Hackish global $wgInputEncoding; if( strcasecmp( $wgInputEncoding, "utf-8" ) == 0 ) { return $data; } else { return utf8_decode( $data ); /* to latin1 wikis */ } } function getSitename() { return $this->getEncoded( $this->Sitename ); } function getSysopName() { return $this->getEncoded( $this->SysopName ); } function getSysopPass() { return $this->getEncoded( $this->SysopPass ); } } ?>Creating LocalSettings.php...
\n\n"; $f = fopen( "LocalSettings.php", "xt" ); if( $f == false ) { dieout( "Couldn't write out LocalSettings.php. Check that the directory permissions are correct and that there isn't already a fiel of that name here." ); } fwrite( $f, "<" . "?php\n$local\n?" . ">" ); fclose( $f ); print "Success! Move the LocalSettings.php file into the parent directory, then follow this link to your wiki.
\n"; } while( false ); } ?>Something's not quite right yet; make sure everything below is filled out correctly.
\n"; } ?> DBadminuser}\"; \$wgDBadminpassword = \"{$conf->DBadminpassword}\"; "; } function writeLocalSettings( $conf ) { $conf->DBmysql4 = $conf->DBmysql4 ? 'true' : 'false'; $conf->UseImageResize = $conf->UseImageResize ? 'true' : 'false'; $conf->DBsqluser = $conf->DBuser; $conf->DBsqlpassword = $conf->DBpassword; $conf->PasswordSender = $conf->EmergencyContact; if( $conf->LanguageCode == "en-utf8" ) { $conf->LanguageCode = "en"; $conf->Encoding = "UTF-8"; } return " # This file was automatically generated. Don't touch unless you # know what you're doing; see LocalSettings.sample for an edit- # friendly file. \$IP = \"{$conf->IP}\"; ini_set( \"include_path\", \"\$IP/includes:\$IP/languages:\" . ini_get(\"include_path\") ); include_once( \"DefaultSettings.php\" ); if( \$wgCommandLineMode ) { die( \"Can't use command-line utils with in-place install yet, sorry.\" ); } \$wgSitename = \"{$conf->Sitename}\"; \$wgScriptPath = \"{$conf->ScriptPath}\"; \$wgScript = \"\$wgScriptPath/index.php\"; \$wgRedirectScript = \"\$wgScriptPath/redirect.php\"; \$wgArticlePath = \"\$wgScript?title=\$1\"; # \$wgArticlePath = \"\$wgScript/\$1\"; # Prettier if you're setup for it \$wgStyleSheetPath = \"\$wgScriptPath/stylesheets\"; \$wgStyleSheetDirectory = \"\$IP/stylesheets\"; \$wgUploadPath = \"\$wgScriptPath/images\"; \$wgUploadDirectory = \"\$IP/images\"; \$wgLogo = \"\$wgUploadPath/wiki.png\"; \$wgEmergencyContact = \"{$conf->EmergencyContact}\"; \$wgPasswordSender = \"{$conf->PasswordSender}\"; \$wgDBserver = \"{$conf->DBserver}\"; \$wgDBname = \"{$conf->DBname}\"; \$wgDBuser = \"{$conf->DBuser}\"; \$wgDBpassword = \"{$conf->DBpassword}\"; \$wgDBsqluser = \"{$conf->DBsqluser}\"; \$wgDBsqlpassword = \"{$conf->DBsqlpassword}\"; \$wgDBmysql4 = \$wgEnablePersistentLC = {$conf->DBmysql4}; \$wgUseImageResize = {$conf->UseImageResize}; ## If you have the appropriate support software installed ## you can enable inline LaTeX equations: # \$wgUseTeX = true; # \$wgMathPath = \"{$wgUploadPath}/math\"; # \$wgMathDirectory = \"{$wgUploadDirectory}/math\"; # \$wgTmpDirectory = \"{$wgUploadDirectory}/tmp\"; \$wgLocalInterwiki = \$wgSitename; \$wgLanguageCode = \"{$conf->LanguageCode}\"; " . ($conf->Encoding ? "\$wgInputEncoding = \$wgOutputEncoding = \"{$conf->Encoding}\";" : "" ) . " "; } function dieout( $text ) { die( $text . "\n\n\n" ); } function importPost( $name, $default = "" ) { if( isset( $_POST[$name] ) ) { return $_POST[$name]; } else { return $default; } } function aField( &$conf, $field, $text, $type = "" ) { if( $type != "" ) $type = "type=\"$type\""; echo "\t\t\n"; echo "\t\t$field ); echo "\" />\n"; global $errs; if(isset($errs[$field])) echo "" . $errs[$field] . "\n"; } function getLanguageList() { global $wgLanguageNames; if( !isset( $wgLanguageNames ) ) { $wgLanguageCode = "xxx"; function wfLocalUrl( $x ) { return $x; } function wfLocalUrlE( $x ) { return $x; } include( "../languages/Language.php" ); } $codes = array(); $latin1 = array( "da", "de", "en", "es", "fr", "nl", "sv" ); $d = opendir( "../languages" ); while( false !== ($f = readdir( $d ) ) ) { if( preg_match( '/Language([A-Z][a-z]+)\.php$/', $f, $m ) ) { $code = strtolower( $m[1] ); $codes[$code] = "$code - " . $wgLanguageNames[$code]; if( in_array( $code, $latin1 ) ) { $codes[$code] .= " - Latin-1"; } } } $codes["en-utf8"] = "en - English - Unicode"; closedir( $d ); ksort( $codes ); return $codes; } ?>