mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-13 17:27:20 +00:00
Re-add BC alias for the VariableHolder class
Looks like it's needed for the UpdateVarDumps script, so add a note about that. Also add a type check to the script so that it produces a clearer error message if it finds an entity with unexpected type. Bug: T331861 Change-Id: I68f8f954ed754c4282e13599ce06118e2336ecbb
This commit is contained in:
parent
0abb60955d
commit
d5b810e23a
|
@ -212,6 +212,10 @@
|
|||
"ExtensionMessagesFiles": {
|
||||
"AbuseFilterAliases": "AbuseFilter.alias.php"
|
||||
},
|
||||
"AutoloadClasses": {
|
||||
"AbuseFilterVariableHolder": "includes/Variables/VariableHolder.php",
|
||||
"MediaWiki\\Extension\\AbuseFilter\\Variables\\VariableHolder": "includes/Variables/VariableHolder.php"
|
||||
},
|
||||
"AutoloadNamespaces": {
|
||||
"MediaWiki\\Extension\\AbuseFilter\\": "includes/",
|
||||
"MediaWiki\\Extension\\AbuseFilter\\Maintenance\\": "maintenance/"
|
||||
|
|
|
@ -112,3 +112,7 @@ class VariableHolder {
|
|||
unset( $this->mVars[$varName] );
|
||||
}
|
||||
}
|
||||
|
||||
// @deprecated Since 1.36. Kept for BC with the UpdateVarDumps script, see T331861. The alias can be removed
|
||||
// once we no longer support updating from a MW version where that script may run.
|
||||
class_alias( VariableHolder::class, 'AbuseFilterVariableHolder' );
|
||||
|
|
|
@ -558,8 +558,11 @@ class UpdateVarDumps extends LoggedUpdateMaintenance {
|
|||
if ( $obj instanceof VariableHolder ) {
|
||||
$varManager = AbuseFilterServices::getVariablesManager();
|
||||
$varArray = $varManager->dumpAllVars( $obj, [ 'old_wikitext', 'new_wikitext' ] );
|
||||
} else {
|
||||
} elseif ( is_array( $obj ) ) {
|
||||
$varArray = $obj;
|
||||
} else {
|
||||
$type = is_object( $obj ) ? get_class( $obj ) : gettype( $obj );
|
||||
throw new UnexpectedValueException( "Unexpected type for stored blob: $type" );
|
||||
}
|
||||
$varArray = $this->updateVariables( $varArray );
|
||||
// Recreating flags will also ensure that we don't add 'nativeDataArray'
|
||||
|
|
Loading…
Reference in a new issue