# This is called on page move and undelete, as well as edit
/* static */ function onArticleCreate($title_obj){
- global $wgEnablePersistentLC, $wgUseSquid, $wgDeferredUpdateList;
+ global $wgUseSquid, $wgDeferredUpdateList;
$titles = $title_obj->getBrokenLinksTo();
}
# Clear persistent link cache
- if ( $wgEnablePersistentLC ) {
- LinkCache::linksccClearBrokenLinksTo( $title_obj->getPrefixedDBkey() );
- }
+ LinkCache::linksccClearBrokenLinksTo( $title_obj->getPrefixedDBkey() );
}
/* static */ function onArticleDelete($title_obj){
- global $wgEnablePersistentLC;
- if ( $wgEnablePersistentLC ) {
- LinkCache::linksccClearLinksTo( $title_obj->getArticleID() );
- }
+ LinkCache::linksccClearLinksTo( $title_obj->getArticleID() );
}
/* static */ function onArticleEdit($title_obj){
- global $wgEnablePersistentLC;
- if ( $wgEnablePersistentLC ) {
- LinkCache::linksccClearPage( $title_obj->getArticleID() );
- }
+ LinkCache::linksccClearPage( $title_obj->getArticleID() );
}
}
if ( $wgEnablePersistentLC ) {
if( $this->fillFromLinkscc( $id ) ){
+ wfProfileOut( $fname );
return;
}
}
# $pid is a page id
/* static */ function linksccClearLinksTo( $pid ){
- $pid = intval( $pid );
- wfQuery("DELETE linkscc FROM linkscc,links ".
- "WHERE lcc_pageid=links.l_from AND l_to={$pid}", DB_WRITE);
- wfQuery("DELETE FROM linkscc WHERE lcc_pageid='{$pid}'", DB_WRITE);
+ global $wgEnablePersistentLC;
+ if ( $wgEnablePersistentLC ) {
+ $pid = intval( $pid );
+ wfQuery("DELETE linkscc FROM linkscc,links ".
+ "WHERE lcc_pageid=links.l_from AND l_to={$pid}", DB_WRITE);
+ wfQuery("DELETE FROM linkscc WHERE lcc_pageid='{$pid}'", DB_WRITE);
+ }
}
# $title is a prefixed db title, for example like Title->getPrefixedDBkey() returns.
/* static */ function linksccClearBrokenLinksTo( $title ){
- $title = wfStrencode( $title );
- wfQuery("DELETE linkscc FROM linkscc,brokenlinks ".
- "WHERE lcc_pageid=bl_from AND bl_to='{$title}'", DB_WRITE);
+ global $wgEnablePersistentLC;
+ if ( $wgEnablePersistentLC ) {
+ $title = wfStrencode( $title );
+ wfQuery("DELETE linkscc FROM linkscc,brokenlinks ".
+ "WHERE lcc_pageid=bl_from AND bl_to='{$title}'", DB_WRITE);
+ }
}
# $pid is a page id
/* static */ function linksccClearPage( $pid ){
- $pid = intval( $pid );
- wfQuery("DELETE FROM linkscc WHERE lcc_pageid='{$pid}'", DB_WRITE);
+ global $wgEnablePersistentLC;
+ if ( $wgEnablePersistentLC ) {
+ $pid = intval( $pid );
+ wfQuery("DELETE FROM linkscc WHERE lcc_pageid='{$pid}'", DB_WRITE);
+ }
}
}
?>