mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite
synced 2024-11-13 17:53:09 +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 ) {
|
if ( !$wgCiteStoreReferencesData || $wgCiteCacheRawReferencesOnParse ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if we can, avoid clearing the cache when references were not changed
|
// if we can, avoid clearing the cache when references were not changed
|
||||||
if ( method_exists( $linksUpdate, 'getAddedProperties' )
|
if ( isset( $linksUpdate->getAddedProperties()['references-1'] )
|
||||||
&& method_exists( $linksUpdate, 'getRemovedProperties' )
|
|| isset( $linksUpdate->getRemovedProperties()['references-1'] )
|
||||||
) {
|
) {
|
||||||
$addedProps = $linksUpdate->getAddedProperties();
|
$cache = MediaWikiServices::getInstance()->getMainWANObjectCache();
|
||||||
$removedProps = $linksUpdate->getRemovedProperties();
|
$articleID = $linksUpdate->getTitle()->getArticleID();
|
||||||
if ( !isset( $addedProps['references-1'] )
|
$key = $cache->makeKey( Cite::EXT_DATA_KEY, $articleID );
|
||||||
&& !isset( $removedProps['references-1'] )
|
// delete with reduced hold off period (LinksUpdate uses a master connection)
|
||||||
) {
|
$cache->delete( $key, WANObjectCache::MAX_COMMIT_DELAY );
|
||||||
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 );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue