mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite
synced 2024-11-12 01:01:29 +00:00
Get rid of obsolete method_exists() checks
Change-Id: Ic3396537a8bf5dc39fd3bea089ebd2292e1c6be5
This commit is contained in:
parent
7157c7f494
commit
deca410d59
|
@ -268,23 +268,17 @@ class CiteHooks {
|
|||
if ( !$wgCiteStoreReferencesData || $wgCiteCacheRawReferencesOnParse ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// if we can, avoid clearing the cache when references were not changed
|
||||
if ( method_exists( $linksUpdate, 'getAddedProperties' )
|
||||
&& method_exists( $linksUpdate, 'getRemovedProperties' )
|
||||
if ( isset( $linksUpdate->getAddedProperties()['references-1'] )
|
||||
|| isset( $linksUpdate->getRemovedProperties()['references-1'] )
|
||||
) {
|
||||
$addedProps = $linksUpdate->getAddedProperties();
|
||||
$removedProps = $linksUpdate->getRemovedProperties();
|
||||
if ( !isset( $addedProps['references-1'] )
|
||||
&& !isset( $removedProps['references-1'] )
|
||||
) {
|
||||
return;
|
||||
}
|
||||
$cache = MediaWikiServices::getInstance()->getMainWANObjectCache();
|
||||
$articleID = $linksUpdate->getTitle()->getArticleID();
|
||||
$key = $cache->makeKey( Cite::EXT_DATA_KEY, $articleID );
|
||||
// delete with reduced hold off period (LinksUpdate uses a master connection)
|
||||
$cache->delete( $key, WANObjectCache::MAX_COMMIT_DELAY );
|
||||
}
|
||||
$cache = MediaWikiServices::getInstance()->getMainWANObjectCache();
|
||||
$articleID = $linksUpdate->getTitle()->getArticleID();
|
||||
$key = $cache->makeKey( Cite::EXT_DATA_KEY, $articleID );
|
||||
// delete with reduced hold off period (LinksUpdate uses a master connection)
|
||||
$cache->delete( $key, WANObjectCache::MAX_COMMIT_DELAY );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue