can define new Collation classes.
(I plan to commit such an extension shortly)
Wasn't sure if it would be better to make an array mapping collation names => class names
instead. However, that seemed to be unneededly complicated so I went with
letting that variable take class names.
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 features in 1.19 ===
* BREAKING CHANGE: action=watch / action=unwatch now requires a token.
case 'uca-default':
return new IcuCollation( 'root' );
default:
- throw new MWException( __METHOD__.": unknown collation type \"$collationName\"" );
+ # 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\"" );
+ }
}
}
*
* After you change this, you must run maintenance/updateCollation.php to fix
* the sort keys in the database.
+ *
+ * Extensions can define there own collations by subclassing Collation
+ * and using the class name as the value of this variable.
*/
$wgCategoryCollation = 'uppercase';