summaryrefslogtreecommitdiff
path: root/maintenance
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2011-12-03 09:20:55 +0100
committerPierre Schmitz <pierre@archlinux.de>2011-12-03 09:20:55 +0100
commita22fbfc60f36f5f7ee10d5ae6fe347340c2ee67c (patch)
tree31882fdc36540fecfd62e5011fc38515e504a3db /maintenance
parent6ca0c5e0a943b64b4e3d0a11a80c5679f7252e64 (diff)
Update to MediaWiki 1.17.1
Diffstat (limited to 'maintenance')
-rw-r--r--maintenance/Maintenance.php12
-rw-r--r--maintenance/oracle/archives/patch_remove_not_null_empty_defs.sql9
-rw-r--r--maintenance/oracle/tables.sql16
-rw-r--r--maintenance/purgeList.php2
-rw-r--r--maintenance/rebuildImages.php2
-rw-r--r--maintenance/rebuildrecentchanges.php1
-rw-r--r--maintenance/upgrade1_5.php2
7 files changed, 30 insertions, 14 deletions
diff --git a/maintenance/Maintenance.php b/maintenance/Maintenance.php
index d7297e98..24bb7809 100644
--- a/maintenance/Maintenance.php
+++ b/maintenance/Maintenance.php
@@ -565,10 +565,14 @@ abstract class Maintenance {
} elseif ( substr( $arg, 0, 2 ) == '--' ) {
# Long options
$option = substr( $arg, 2 );
+ if ( array_key_exists( $option, $options ) ) {
+ $this->error( "\nERROR: $option parameter given twice\n" );
+ $this->maybeHelp( true );
+ }
if ( isset( $this->mParams[$option] ) && $this->mParams[$option]['withArg'] ) {
$param = next( $argv );
if ( $param === false ) {
- $this->error( "\nERROR: $option needs a value after it\n" );
+ $this->error( "\nERROR: $option parameter needs a value after it\n" );
$this->maybeHelp( true );
}
$options[$option] = $param;
@@ -586,10 +590,14 @@ abstract class Maintenance {
# Short options
for ( $p = 1; $p < strlen( $arg ); $p++ ) {
$option = $arg { $p } ;
+ if ( array_key_exists( $option, $options ) ) {
+ $this->error( "\nERROR: $option parameter given twice\n" );
+ $this->maybeHelp( true );
+ }
if ( isset( $this->mParams[$option]['withArg'] ) && $this->mParams[$option]['withArg'] ) {
$param = next( $argv );
if ( $param === false ) {
- $this->error( "\nERROR: $option needs a value after it\n" );
+ $this->error( "\nERROR: $option parameter needs a value after it\n" );
$this->maybeHelp( true );
}
$options[$option] = $param;
diff --git a/maintenance/oracle/archives/patch_remove_not_null_empty_defs.sql b/maintenance/oracle/archives/patch_remove_not_null_empty_defs.sql
new file mode 100644
index 00000000..76e50a0a
--- /dev/null
+++ b/maintenance/oracle/archives/patch_remove_not_null_empty_defs.sql
@@ -0,0 +1,9 @@
+define mw_prefix='{$wgDBprefix}';
+
+ALTER TABLE &mw_prefix.categorylinks MODIFY cl_sortkey_prefix DEFAULT NULL NULL;
+ALTER TABLE &mw_prefix.categorylinks MODIFY cl_collation DEFAULT NULL NULL;
+ALTER TABLE &mw_prefix.iwlinks MODIFY iwl_prefix DEFAULT NULL NULL;
+ALTER TABLE &mw_prefix.iwlinks MODIFY iwl_title DEFAULT NULL NULL;
+ALTER TABLE &mw_prefix.searchindex MODIFY si_title DEFAULT NULL NULL;
+ALTER TABLE &mw_prefix.querycachetwo MODIFY qcc_title DEFAULT NULL NULL;
+ALTER TABLE &mw_prefix.querycachetwo MODIFY qcc_titletwo DEFAULT NULL NULL;
diff --git a/maintenance/oracle/tables.sql b/maintenance/oracle/tables.sql
index b8ecc2b9..f6d29f54 100644
--- a/maintenance/oracle/tables.sql
+++ b/maintenance/oracle/tables.sql
@@ -26,7 +26,7 @@ CREATE INDEX &mw_prefix.mwuser_i01 ON &mw_prefix.mwuser (user_email_token);
-- Create a dummy user to satisfy fk contraints especially with revisions
INSERT INTO &mw_prefix.mwuser
- VALUES (user_user_id_seq.nextval,'Anonymous','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, '', current_timestamp, current_timestamp, 0);
+ VALUES (user_user_id_seq.nextval,'Anonymous',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, '', current_timestamp, current_timestamp, 0);
CREATE TABLE &mw_prefix.user_groups (
ug_user NUMBER DEFAULT 0 NOT NULL,
@@ -168,9 +168,9 @@ CREATE TABLE &mw_prefix.categorylinks (
cl_from NUMBER NOT NULL,
cl_to VARCHAR2(255) NOT NULL,
cl_sortkey VARCHAR2(230),
- cl_sortkey_prefix VARCHAR2(255) DEFAULT '' NOT NULL,
+ cl_sortkey_prefix VARCHAR2(255),
cl_timestamp TIMESTAMP(6) WITH TIME ZONE NOT NULL,
- cl_collation VARCHAR2(32) DEFAULT '' NOT NULL,
+ cl_collation VARCHAR2(32),
cl_type VARCHAR2(6) DEFAULT 'page' NOT NULL
);
ALTER TABLE &mw_prefix.categorylinks ADD CONSTRAINT &mw_prefix.categorylinks_fk1 FOREIGN KEY (cl_from) REFERENCES &mw_prefix.page(page_id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED;
@@ -220,8 +220,8 @@ CREATE INDEX &mw_prefix.langlinks_i01 ON &mw_prefix.langlinks (ll_lang, ll_title
CREATE TABLE &mw_prefix.iwlinks (
iwl_from NUMBER DEFAULT 0 NOT NULL,
- iwl_prefix VARCHAR2(20) DEFAULT '' NOT NULL,
- iwl_title VARCHAR2(255) DEFAULT '' NOT NULL
+ iwl_prefix VARCHAR2(20),
+ iwl_title VARCHAR2(255)
);
CREATE UNIQUE INDEX &mw_prefix.iwlinks_ui01 ON &mw_prefix.iwlinks (iwl_from, iwl_prefix, iwl_title);
CREATE UNIQUE INDEX &mw_prefix.iwlinks_ui02 ON &mw_prefix.iwlinks (iwl_prefix, iwl_title, iwl_from);
@@ -416,7 +416,7 @@ CREATE UNIQUE INDEX &mw_prefix.math_u01 ON &mw_prefix.math (math_inputhash);
CREATE TABLE &mw_prefix.searchindex (
si_page NUMBER NOT NULL,
- si_title VARCHAR2(255) DEFAULT '' NOT NULL,
+ si_title VARCHAR2(255),
si_text CLOB NOT NULL
);
CREATE UNIQUE INDEX &mw_prefix.searchindex_u01 ON &mw_prefix.searchindex (si_page);
@@ -528,9 +528,9 @@ CREATE TABLE &mw_prefix.querycachetwo (
qcc_type VARCHAR2(32) NOT NULL,
qcc_value NUMBER DEFAULT 0 NOT NULL,
qcc_namespace NUMBER DEFAULT 0 NOT NULL,
- qcc_title VARCHAR2(255) DEFAULT '' NOT NULL,
+ qcc_title VARCHAR2(255),
qcc_namespacetwo NUMBER DEFAULT 0 NOT NULL,
- qcc_titletwo VARCHAR2(255) DEFAULT '' NOT NULL
+ qcc_titletwo VARCHAR2(255)
);
CREATE INDEX &mw_prefix.querycachetwo_i01 ON &mw_prefix.querycachetwo (qcc_type,qcc_value);
CREATE INDEX &mw_prefix.querycachetwo_i02 ON &mw_prefix.querycachetwo (qcc_type,qcc_namespace,qcc_title);
diff --git a/maintenance/purgeList.php b/maintenance/purgeList.php
index 17be6d3d..2c0308c0 100644
--- a/maintenance/purgeList.php
+++ b/maintenance/purgeList.php
@@ -43,7 +43,7 @@ class PurgeList extends Maintenance {
$url = $title->getFullUrl();
$this->output( "$url\n" );
$urls[] = $url;
- if ( $this->getOptions( 'purge' ) ) {
+ if ( $this->getOption( 'purge' ) ) {
$title->invalidateCache();
}
} else {
diff --git a/maintenance/rebuildImages.php b/maintenance/rebuildImages.php
index 1848b104..c61d9480 100644
--- a/maintenance/rebuildImages.php
+++ b/maintenance/rebuildImages.php
@@ -209,4 +209,4 @@ class ImageBuilder extends Maintenance {
}
$maintClass = 'ImageBuilder';
-require( RUN_MAINTENANCE_IF_MAIN );
+require_once( RUN_MAINTENANCE_IF_MAIN );
diff --git a/maintenance/rebuildrecentchanges.php b/maintenance/rebuildrecentchanges.php
index 8964d1a4..5cacac65 100644
--- a/maintenance/rebuildrecentchanges.php
+++ b/maintenance/rebuildrecentchanges.php
@@ -132,7 +132,6 @@ class RebuildRecentchanges extends Maintenance {
} else {
# Grab the entry's text size
$size = $dbw->selectField( 'revision', 'rev_len', array( 'rev_id' => $obj->rc_this_oldid ) );
- $size = !is_null( $size ) ? intval( $size ) : 'NULL';
$dbw->update( 'recentchanges',
array(
diff --git a/maintenance/upgrade1_5.php b/maintenance/upgrade1_5.php
index c5e1a33d..e919c62e 100644
--- a/maintenance/upgrade1_5.php
+++ b/maintenance/upgrade1_5.php
@@ -1307,4 +1307,4 @@ END
}
$maintClass = 'FiveUpgrade';
-require( RUN_MAINTENANCE_IF_MAIN );
+require_once( RUN_MAINTENANCE_IF_MAIN );