summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Starling <tstarling@users.mediawiki.org>2004-05-22 07:05:45 +0000
committerTim Starling <tstarling@users.mediawiki.org>2004-05-22 07:05:45 +0000
commitcaf82594f5edde725bfe817279e2dfa03db336d1 (patch)
treed00a5519c744e22f020767438d38976d04697a40
parentdd74ff399ad7616640252a03519c1f6c79f1d8b9 (diff)
1.2 -> 1.3 conversion using the web-based installer1.3.0beta1
Notes
http://mediawiki.org/wiki/Special:Code/MediaWiki/3655
-rw-r--r--config/index.php54
-rw-r--r--maintenance/archives/moveCustomMessages.inc6
-rw-r--r--maintenance/convertLinks.inc3
3 files changed, 47 insertions, 16 deletions
diff --git a/config/index.php b/config/index.php
index 16d17a2f716f..ad1cc1635880 100644
--- a/config/index.php
+++ b/config/index.php
@@ -153,6 +153,9 @@ if( !is_writable( "." ) ) {
require( "../install-utils.inc" );
require( "../maintenance/updaters.inc" );
+require( "../maintenance/convertLinks.inc" );
+require( "../maintenance/archives/moveCustomMessages.inc" );
+
class ConfigData {
function getEncoded( $data ) {
# Hackish
@@ -399,11 +402,20 @@ if( $conf->posted && ( 0 == count( $errs ) ) ) {
do_linkscc_update(); flush();
do_hitcounter_update(); flush();
do_recentchanges_update(); flush();
- echo "FIXME: need the link table change here\n";
+ convertLinks(); flush();
do_user_real_name_update(); flush();
do_querycache_update(); flush();
do_objectcache_update(); flush();
do_categorylinks_update(); flush();
+
+ if ( isTemplateInitialised() ) {
+ print "Template namespace already initialised\n";
+ } else {
+ moveCustomMessages( 1 ); flush();
+ moveCustomMessages( 2 ); flush();
+ moveCustomMessages( 3 ); flush();
+ }
+
initialiseMessages(); flush();
chdir( "config" );
@@ -686,8 +698,19 @@ function writeLocalSettings( $conf ) {
$pretty = ($conf->prettyURLs ? "" : "# ");
$ugly = ($conf->prettyURLs ? "# " : "");
$rights = ($conf->RightsUrl) ? "" : "# ";
+
+ $file = @fopen( "/dev/random", "r" );
+ if ( $file ) {
+ $proxyKey = bin2hex( fread( $file, 32 ) );
+ fclose( $file );
+ } else {
+ $proxyKey = "";
+ for ( $i=0; $i<8; $i++ ) {
+ $proxyKey .= dechex(mt_rand(0, 0x7fffffff));
+ }
+ print "Warning: \$wgProxyKey is insecure\n";
+ }
-# $proxyKey = Parser::getRandomString() . Parser::getRandomString();
# Add slashes to strings for double quoting
$slconf = array_map( "addslashes", get_object_vars( $conf ) );
@@ -698,7 +721,7 @@ function writeLocalSettings( $conf ) {
# If you make manual changes, please keep track in case you need to
# recreate them later.
-\$IP = \"{$slconf[IP]}\";
+\$IP = \"{$slconf['IP']}\";
ini_set( \"include_path\", \"\$IP/includes$sep\$IP/languages$sep\" . ini_get(\"include_path\") );
include_once( \"DefaultSettings.php\" );
@@ -711,9 +734,9 @@ if ( \$wgCommandLineMode ) {
{$zlib}if( !ini_get( 'zlib.output_compression' ) ) ob_start( 'ob_gzhandler' );
}
-\$wgSitename = \"{$slconf[Sitename]}\";
+\$wgSitename = \"{$slconf['Sitename']}\";
-\$wgScriptPath = \"{$slconf[ScriptPath]}\";
+\$wgScriptPath = \"{$slconf['ScriptPath']}\";
\$wgScript = \"\$wgScriptPath/index.php\";
\$wgRedirectScript = \"\$wgScriptPath/redirect.php\";
@@ -728,13 +751,13 @@ if ( \$wgCommandLineMode ) {
\$wgUploadPath = \"\$wgScriptPath/images\";
\$wgUploadDirectory = \"\$IP/images\";
-\$wgEmergencyContact = \"{$slconf[EmergencyContact]}\";
-\$wgPasswordSender = \"{$slconf[PasswordSender]}\";
+\$wgEmergencyContact = \"{$slconf['EmergencyContact']}\";
+\$wgPasswordSender = \"{$slconf['PasswordSender']}\";
-\$wgDBserver = \"{$slconf[DBserver]}\";
-\$wgDBname = \"{$slconf[DBname]}\";
-\$wgDBuser = \"{$slconf[DBuser]}\";
-\$wgDBpassword = \"{$slconf[DBpassword]}\";
+\$wgDBserver = \"{$slconf['DBserver']}\";
+\$wgDBname = \"{$slconf['DBname']}\";
+\$wgDBuser = \"{$slconf['DBuser']}\";
+\$wgDBpassword = \"{$slconf['DBpassword']}\";
## To allow SQL queries through the wiki's Special:Askaql page,
## uncomment the next lines. THIS IS VERY INSECURE. If you want
@@ -764,16 +787,15 @@ if ( \$wgCommandLineMode ) {
\$wgLocalInterwiki = \$wgSitename;
-\$wgLanguageCode = \"{$slconf[LanguageCode]}\";
-" . ($conf->Encoding ? "\$wgInputEncoding = \$wgOutputEncoding = \"{$slconf[Encoding]}\";" : "" ) . "
+\$wgLanguageCode = \"{$slconf['LanguageCode']}\";
+" . ($conf->Encoding ? "\$wgInputEncoding = \$wgOutputEncoding = \"{$slconf['Encoding']}\";" : "" ) . "
+
+\$wgProxyKey = \"$proxyKey\";
## Default skin: you can change the default skin. Use the internal symbolic
## names, ie 'standard', 'nostalgia', 'cologneblue', 'monobook':
# \$wgDefaultSkin = 'monobook';
-## This is incomplete, ignore it:
-#\$wgProxyKey = $proxyKey;
-
## For attaching licensing metadata to pages, and displaying an
## appropriate copyright notice / icon. GNU Free Documentation
## License and Creative Commons licenses are supported so far.
diff --git a/maintenance/archives/moveCustomMessages.inc b/maintenance/archives/moveCustomMessages.inc
index 8ad118d6c71f..dd5e8aee82b5 100644
--- a/maintenance/archives/moveCustomMessages.inc
+++ b/maintenance/archives/moveCustomMessages.inc
@@ -1,5 +1,11 @@
<?
+function isTemplateInitialised() {
+ $sql = "SELECT 1 FROM cur WHERE cur_namespace=" . NS_TEMPLATE . " LIMIT 1";
+ $res = wfQuery( $sql, DB_READ );
+ return wfNumRows( $res ) ? true : false;
+}
+
function moveCustomMessages( $phase ) {
global $wgUser, $wgAllMessagesEn, $wgDeferredUpdateList, $wgLang ;
$wgUser = new User;
diff --git a/maintenance/convertLinks.inc b/maintenance/convertLinks.inc
index a2acf67eb849..4ca7cd4e6107 100644
--- a/maintenance/convertLinks.inc
+++ b/maintenance/convertLinks.inc
@@ -1,6 +1,8 @@
<?php
function convertLinks() {
+ print "Converting links table to ID-ID...\n";
+
global $wgLang, $wgDBserver, $wgDBadminuser, $wgDBadminpassword, $wgDBname;
$numRows = $tuplesAdded = $numBadLinks = $curRowsRead = 0; #counters etc
@@ -149,6 +151,7 @@ function convertLinks() {
print "Conversion complete. The converted table is at links_temp;\n";
print "the original links table is unchanged.\n";
}
+}
#--------------------------------------------------------------------