From: Ævar Arnfjörð Bjarmason Date: Sat, 8 Oct 2005 19:24:47 +0000 (+0000) Subject: * Added a new hook which allows an extension to control whether or not the X-Git-Tag: 1.6.0~1503 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dcompta/operations/modifier.php?a=commitdiff_plain;h=4708404fe8bb4979f859ce336e4bde220ee9ef01;p=lhc%2Fweb%2Fwiklou.git * Added a new hook which allows an extension to control whether or not the recentchanges table gets purged, default behaviour: same as before --- diff --git a/includes/Article.php b/includes/Article.php index 9aa9092e86..f4de39eb06 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -2133,20 +2133,21 @@ class Article { global $wgDeferredUpdateList, $wgDBname, $wgMemc; global $wgMessageCache, $wgUser, $wgUseEnotif; - wfSeedRandom(); - if ( 0 == mt_rand( 0, 999 ) ) { - # Periodically flush old entries from the recentchanges table. - global $wgRCMaxAge; - $dbw =& wfGetDB( DB_MASTER ); - $cutoff = $dbw->timestamp( time() - $wgRCMaxAge ); - $recentchanges = $dbw->tableName( 'recentchanges' ); - $sql = "DELETE FROM $recentchanges WHERE rc_timestamp < '{$cutoff}'"; - //$dbw->query( $sql ); // HACK: disabled for now, slowness - - // re-enabled for commit of unrelated live changes -- TS - $dbw->query( $sql ); - } + if ( wfRunHooks( 'ArticleEditUpdatesDeleteFromRecentchanges', &$this ) ) { + wfSeedRandom(); + if ( 0 == mt_rand( 0, 999 ) ) { + # Periodically flush old entries from the recentchanges table. + global $wgRCMaxAge; + + $dbw =& wfGetDB( DB_MASTER ); + $cutoff = $dbw->timestamp( time() - $wgRCMaxAge ); + $recentchanges = $dbw->tableName( 'recentchanges' ); + $sql = "DELETE FROM $recentchanges WHERE rc_timestamp < '{$cutoff}'"; + $dbw->query( $sql ); + } + } + $id = $this->getID(); $title = $this->mTitle->getPrefixedDBkey(); $shortTitle = $this->mTitle->getDBkey();