summaryrefslogtreecommitdiff
path: root/includes/installer
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2012-01-12 13:42:29 +0100
committerPierre Schmitz <pierre@archlinux.de>2012-01-12 13:42:29 +0100
commitba0fc4fa20067528effd4802e53ceeb959640825 (patch)
tree4f62217349d3afa39dbba3f7e19dac0aecb344f6 /includes/installer
parentca32f08966f1b51fcb19460f0996bb0c4048e6fe (diff)
Update to MediaWiki 1.18.1
Diffstat (limited to 'includes/installer')
-rw-r--r--includes/installer/CliInstaller.php8
-rw-r--r--includes/installer/Installer.php9
-rw-r--r--includes/installer/MysqlInstaller.php2
-rw-r--r--includes/installer/OracleUpdater.php32
-rw-r--r--includes/installer/PostgresUpdater.php2
5 files changed, 50 insertions, 3 deletions
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' ),
);
@@ -135,6 +138,24 @@ class OracleUpdater extends DatabaseUpdater {
}
/**
+ * 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
*/
protected function doRebuildDuplicateFunction() {
@@ -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' ),