mirror of
https://github.com/Universal-Omega/PortableInfobox.git
synced 2024-11-15 03:35:53 +00:00
Fix deleting cache and add type hinting to hooks
This commit is contained in:
parent
49c6d8a5b5
commit
e51204ff8b
|
@ -2,26 +2,24 @@
|
|||
|
||||
class PortableInfoboxHooks {
|
||||
|
||||
public static function onWgQueryPages( &$queryPages = [] ) {
|
||||
public static function onWgQueryPages( array &$queryPages = [] ) {
|
||||
$queryPages[] = [ 'AllinfoboxesQueryPage', 'AllInfoboxes' ];
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static function onBeforeParserrenderImageGallery( $parser, $gallery ) {
|
||||
if ( $gallery instanceof ImageGalleryBase ) {
|
||||
PortableInfobox\Helpers\PortableInfoboxDataBag::getInstance()->setGallery(
|
||||
Parser::MARKER_PREFIX . "-gallery-" . sprintf( '%08X', $parser->mMarkerIndex - 1 ) . Parser::MARKER_SUFFIX,
|
||||
$gallery
|
||||
);
|
||||
}
|
||||
public static function onBeforeParserrenderImageGallery( Parser &$parser, ImageGalleryBase &$gallery ) {
|
||||
PortableInfobox\Helpers\PortableInfoboxDataBag::getInstance()->setGallery(
|
||||
Parser::MARKER_PREFIX . "-gallery-" . sprintf( '%08X', $parser->mMarkerIndex - 1 ) . Parser::MARKER_SUFFIX,
|
||||
$gallery
|
||||
);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static function onAllInfoboxesQueryRecached() {
|
||||
$cache = ObjectCache::getMainWANInstance();
|
||||
$cache->delete( $cache->makeKey( __CLASS__, ApiQueryAllinfoboxes::MCACHE_KEY ) );
|
||||
$cache->delete( $cache->makeKey( ApiQueryAllinfoboxes::MCACHE_KEY ) );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue