Follow-up r92887: clear throttle count once the password is accepted as normal
[lhc/web/wiklou.git] / includes / Collation.php
index 1277c50..a6f1cfe 100644 (file)
@@ -4,7 +4,6 @@ abstract class Collation {
        static $instance;
 
        /**
-        * @static
         * @return Collation
         */
        static function singleton() {
@@ -16,7 +15,6 @@ abstract class Collation {
        }
 
        /**
-        * @static
         * @throws MWException
         * @param $collationName string
         * @return Collation
@@ -28,6 +26,16 @@ abstract class Collation {
                        case 'uca-default':
                                return new IcuCollation( 'root' );
                        default:
+                               # Provide a mechanism for extensions to hook in.
+
+                               $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\"" );
                }
        }