From ba0fc4fa20067528effd4802e53ceeb959640825 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Thu, 12 Jan 2012 13:42:29 +0100 Subject: Update to MediaWiki 1.18.1 --- includes/installer/CliInstaller.php | 8 ++++++++ includes/installer/Installer.php | 9 +++++++-- includes/installer/MysqlInstaller.php | 2 +- includes/installer/OracleUpdater.php | 32 ++++++++++++++++++++++++++++++++ includes/installer/PostgresUpdater.php | 2 ++ 5 files changed, 50 insertions(+), 3 deletions(-) (limited to 'includes/installer') diff --git a/includes/installer/CliInstaller.php b/includes/installer/CliInstaller.php index 2ae9d143..41392207 100644 --- a/includes/installer/CliInstaller.php +++ b/includes/installer/CliInstaller.php @@ -31,6 +31,7 @@ class CliInstaller extends Installer { 'dbpass' => 'wgDBpassword', 'dbschema' => 'wgDBmwschema', 'dbpath' => 'wgSQLiteDataDir', + 'server' => 'wgServer', 'scriptpath' => 'wgScriptPath', ); @@ -183,6 +184,13 @@ class CliInstaller extends Installer { return parent::envCheckPath(); } + protected function envCheckServer( $srv = null ) { + if ( $this->getVar( 'wgServer' ) ) { + $srv = $this->getVar( 'wgServer' ); + } + return parent::envCheckServer( $srv ); + } + public function dirIsExecutable( $dir, $url ) { $this->showMessage( 'config-no-cli-uploads-check', $dir ); return false; diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php index 8101f7d6..ef484a8f 100644 --- a/includes/installer/Installer.php +++ b/includes/installer/Installer.php @@ -842,8 +842,13 @@ abstract class Installer { /** * Environment check for the server hostname. */ - protected function envCheckServer() { - $server = WebRequest::detectServer(); + protected function envCheckServer( $srv = null ) { + if ( $srv ) { + // wgServer was pre-defined, perhaps by the cli installer + $server = $srv; + } else { + $server = WebRequest::detectServer(); + } $this->showMessage( 'config-using-server', $server ); $this->setVar( 'wgServer', $server ); } diff --git a/includes/installer/MysqlInstaller.php b/includes/installer/MysqlInstaller.php index 3bb8c114..0c197e6b 100644 --- a/includes/installer/MysqlInstaller.php +++ b/includes/installer/MysqlInstaller.php @@ -168,7 +168,7 @@ class MysqlInstaller extends DatabaseInstaller { $existingEngine = false; } else { if ( preg_match( '/^latin1/', $row->Collation ) ) { - $existingSchema = 'mysql4'; + $existingSchema = 'latin1'; } elseif ( preg_match( '/^utf8/', $row->Collation ) ) { $existingSchema = 'utf8'; } elseif ( preg_match( '/^binary/', $row->Collation ) ) { diff --git a/includes/installer/OracleUpdater.php b/includes/installer/OracleUpdater.php index fb8032f5..964660c5 100644 --- a/includes/installer/OracleUpdater.php +++ b/includes/installer/OracleUpdater.php @@ -36,6 +36,9 @@ class OracleUpdater extends DatabaseUpdater { array( 'addIndex', 'user', 'i02', 'patch-user_email_index.sql' ), array( 'modifyField', 'user_properties', 'up_property', 'patch-up_property.sql' ), array( 'addTable', 'uploadstash', 'patch-uploadstash.sql' ), + array( 'doRecentchangesFK2Cascade' ), + + // KEEP THIS AT THE BOTTOM!! array( 'doRebuildDuplicateFunction' ), ); @@ -134,6 +137,24 @@ class OracleUpdater extends DatabaseUpdater { $this->output( "ok\n" ); } + /** + * Removed forcing of invalid state on recentchanges_fk2. + * cascading taken in account in the deleting function + */ + protected function doRecentchangesFK2Cascade() { + $this->output( "Altering RECENTCHANGES_FK2 ... " ); + + $meta = $this->db->query( 'SELECT 1 FROM all_constraints WHERE owner = \''.strtoupper($this->db->getDBname()).'\' AND constraint_name = \''.$this->db->tablePrefix().'RECENTCHANGES_FK2\' AND delete_rule = \'CASCADE\'' ); + $row = $meta->fetchRow(); + if ( $row ) { + $this->output( "FK up to date\n" ); + return; + } + + $this->applyPatch( 'patch_recentchanges_fk2_cascade.sql', false ); + $this->output( "ok\n" ); + } + /** * rebuilding of the function that duplicates tables for tests */ @@ -154,4 +175,15 @@ class OracleUpdater extends DatabaseUpdater { $this->db->query( 'BEGIN fill_wiki_info; END;' ); } + /** + * Overload: because of the DDL_MODE tablename escaping is a bit dodgy + */ + protected function purgeCache() { + # We can't guarantee that the user will be able to use TRUNCATE, + # but we know that DELETE is available to us + $this->output( "Purging caches..." ); + $this->db->delete( '/*Q*/'.$this->db->tableName( 'objectcache' ), '*', __METHOD__ ); + $this->output( "done.\n" ); + } + } diff --git a/includes/installer/PostgresUpdater.php b/includes/installer/PostgresUpdater.php index 2c9c0595..ade46ac8 100644 --- a/includes/installer/PostgresUpdater.php +++ b/includes/installer/PostgresUpdater.php @@ -33,6 +33,7 @@ class PostgresUpdater extends DatabaseUpdater { array( 'renameSequence', 'rc_rc_id_seq', 'recentchanges_rc_id_seq' ), array( 'renameSequence', 'log_log_id_seq', 'logging_log_id_seq' ), array( 'renameSequence', 'pr_id_val', 'page_restrictions_pr_id_seq' ), + array( 'renameSequence', 'us_id_seq', 'uploadstash_us_id_seq' ), # new tables array( 'addTable', 'category', 'patch-category.sql' ), @@ -54,6 +55,7 @@ class PostgresUpdater extends DatabaseUpdater { array( 'addTable', 'msg_resource', 'patch-msg_resource.sql' ), array( 'addTable', 'msg_resource_links','patch-msg_resource_links.sql' ), array( 'addTable', 'module_deps', 'patch-module_deps.sql' ), + array( 'addTable', 'uploadstash', 'patch-uploadstash.sql' ), # Needed before new field array( 'convertArchive2' ), -- cgit v1.2.2