Remove adding new pages to S:AI cache

This commit is contained in:
Luqgreg 2018-08-15 15:20:56 +02:00
parent 3744074ebb
commit ec915c6fc4
3 changed files with 0 additions and 46 deletions

View file

@ -92,7 +92,6 @@
"wgQueryPages": "PortableInfoboxHooks::onWgQueryPages",
"AllInfoboxesQueryRecached": "PortableInfoboxHooks::onAllInfoboxesQueryRecached",
"ArticlePurge": "PortableInfoboxHooks::onArticlePurge",
"PageContentInsertComplete": "PortableInfoboxHooks::onPageContentInsertComplete",
"PageContentSave": "PortableInfoboxHooks::onPageContentSave"
},
"SpecialPages": {

View file

@ -72,29 +72,4 @@ class PortableInfoboxHooks {
return true;
}
/**
* Insert a newly created infobox into querycache, and purge the list of
* infoboxes.
*
* @param Page $page The created page object
* @param User $user The user who created the page
* @param string $text Text of the new article
* @param string $summary Edit summary
* @param int $minoredit Minor edit flag
* @param boolean $watchThis Whether or not the user should watch the page
* @param null $sectionAnchor Not used, set to null
* @param int $flags Flags for this page
* @param Revision $revision The newly inserted revision object
* @return boolean
*/
public static function onPageContentInsertComplete( Page $page, User $user, $text, $summary, $minoredit,
$watchThis, $sectionAnchor, &$flags, Revision $revision ) {
$title = $page->getTitle();
if ( $title->inNamespace( NS_TEMPLATE ) ) {
( new AllinfoboxesQueryPage() )->addTitleToCache( $title );
}
return true;
}
}

View file

@ -104,26 +104,6 @@ class AllinfoboxesQueryPage extends PageQueryPage {
return new FakeResultWrapper( $out );
}
public function addTitleToCache( Title $title ) {
if ( !$this->hasInfobox( $title ) ) {
return;
}
$dbw = wfGetDB( DB_MASTER );
$dbw->doAtomicSection(
__METHOD__,
function ( IDatabase $dbw, $fname ) use ( $title ) {
$dbw->insert( 'querycache', [
'qc_type' => $this->getName(),
'qc_namespace' => $title->getNamespace(),
'qc_title' => $title->getDBkey()
], $fname );
}
);
Hooks::run( 'AllInfoboxesQueryRecached' );
}
private function hasInfobox( Title $title ) {
// omit subages from blacklist
return !(