was removed in about 1.5.
* LogPageValidTypes, LogPageLogName, LogPageLogHeader and LogPageActionText
hooks have been removed.
-* $wgCategoryCollation can now use a class name as its value, in order for
- extensions to be able to define new collations
+* New hook "Collation::factory" to allow extensions to create custom
+ category collations.
=== New features in 1.19 ===
* BREAKING CHANGE: action=watch / action=unwatch now requires a token.
return new IcuCollation( 'root' );
default:
# Provide a mechanism for extensions to hook in.
- if ( class_exists( $collationName ) ) {
- $collationObject = new $collationName;
- if ( $collationObject instanceof Collation ) {
- return $collationObject;
- } else {
- throw new MWException( __METHOD__.": collation type \"$collationName\""
- . " is not a subclass of Collation." );
- }
- } else {
- throw new MWException( __METHOD__.": unknown collation type \"$collationName\"" );
+
+ $collationObject = null;
+ wfRunHooks( 'Collation::factory', array( $collationName, &$collationObject ) );
+
+ if ( $collationObject instanceof Collation ) {
+ return $collationObject;
}
+
+ // If all else fails...
+ throw new MWException( __METHOD__.": unknown collation type \"$collationName\"" );
}
}