$user: user
$result: result of checking autopromote condition
+'BacklinkCacheGetPrefix': allows to set prefix for a spefific link table
+$table: table name
+&$prefix: prefix
+
+'BacklinkCacheGetConditions': allows to set conditions for query when links to certain title
+are fetched
+$table: table name
+$title: title of the page to which backlinks are sought
+&$conds: query conditions
+
'BadImage': When checking against the bad image list
$name: Image name being checked
&$bad: Whether or not the image is "bad"
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__ );
+ }
}
}
);
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;
foreach ( $batches as $batch ) {
list( $start, $end ) = $batch;
$params = array(
+ 'table' => 'templatelinks',
'start' => $start,
'end' => $end,
);
return false;
}
$titles = $this->title->getBacklinkCache()->getLinks(
- 'templatelinks', $this->params['start'], $this->params['end']);
+ $this->params['table'], $this->params['start'], $this->params['end']);
# Not suitable for page load triggered job running!
# Gracefully switch to refreshLinks jobs if this happens.