summaryrefslogtreecommitdiff
path: root/includes/BacklinkCache.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/BacklinkCache.php')
-rw-r--r--includes/BacklinkCache.php17
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;