diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2012-05-03 13:01:35 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2012-05-03 13:01:35 +0200 |
commit | d9022f63880ce039446fba8364f68e656b7bf4cb (patch) | |
tree | 16b40fbf17bf7c9ee6f4ead25b16dd192378050a /includes/BacklinkCache.php | |
parent | 27cf83d177256813e2e802241085fce5dd0f3fb9 (diff) |
Update to MediaWiki 1.19.0
Diffstat (limited to 'includes/BacklinkCache.php')
-rw-r--r-- | includes/BacklinkCache.php | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/includes/BacklinkCache.php b/includes/BacklinkCache.php index 8d1571ec..d17104f8 100644 --- a/includes/BacklinkCache.php +++ b/includes/BacklinkCache.php @@ -22,7 +22,7 @@ * @author Tim Starling * @copyright © 2009, Tim Starling, Domas Mituzas * @copyright © 2010, Max Sem - * @copyright © 2011, Ashar Voultoiz + * @copyright © 2011, Antoine Musso */ class BacklinkCache { @@ -75,6 +75,8 @@ class BacklinkCache { * Serialization handler, diasallows to serialize the database to prevent * failures after this class is deserialized from cache with dead DB * connection. + * + * @return array */ function __sleep() { return array( 'partitionCache', 'fullResultCache', 'title' ); @@ -190,7 +192,13 @@ class BacklinkCache { if ( isset( $prefixes[$table] ) ) { return $prefixes[$table]; } else { - throw new MWException( "Invalid table \"$table\" in " . __CLASS__ ); + $prefix = null; + wfRunHooks( 'BacklinkCacheGetPrefix', array( $table, &$prefix ) ); + if( $prefix ) { + return $prefix; + } else { + throw new MWException( "Invalid table \"$table\" in " . __CLASS__ ); + } } } @@ -237,7 +245,10 @@ class BacklinkCache { ); break; default: - throw new MWException( "Invalid table \"$table\" in " . __CLASS__ ); + $conds = null; + wfRunHooks( 'BacklinkCacheGetConditions', array( $table, $this->title, &$conds ) ); + if( !$conds ) + throw new MWException( "Invalid table \"$table\" in " . __CLASS__ ); } return $conds; |