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 {
|
class PortableInfoboxHooks {
|
||||||
|
|
||||||
public static function onWgQueryPages( &$queryPages = [] ) {
|
public static function onWgQueryPages( array &$queryPages = [] ) {
|
||||||
$queryPages[] = [ 'AllinfoboxesQueryPage', 'AllInfoboxes' ];
|
$queryPages[] = [ 'AllinfoboxesQueryPage', 'AllInfoboxes' ];
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function onBeforeParserrenderImageGallery( $parser, $gallery ) {
|
public static function onBeforeParserrenderImageGallery( Parser &$parser, ImageGalleryBase &$gallery ) {
|
||||||
if ( $gallery instanceof ImageGalleryBase ) {
|
PortableInfobox\Helpers\PortableInfoboxDataBag::getInstance()->setGallery(
|
||||||
PortableInfobox\Helpers\PortableInfoboxDataBag::getInstance()->setGallery(
|
Parser::MARKER_PREFIX . "-gallery-" . sprintf( '%08X', $parser->mMarkerIndex - 1 ) . Parser::MARKER_SUFFIX,
|
||||||
Parser::MARKER_PREFIX . "-gallery-" . sprintf( '%08X', $parser->mMarkerIndex - 1 ) . Parser::MARKER_SUFFIX,
|
$gallery
|
||||||
$gallery
|
);
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function onAllInfoboxesQueryRecached() {
|
public static function onAllInfoboxesQueryRecached() {
|
||||||
$cache = ObjectCache::getMainWANInstance();
|
$cache = ObjectCache::getMainWANInstance();
|
||||||
$cache->delete( $cache->makeKey( __CLASS__, ApiQueryAllinfoboxes::MCACHE_KEY ) );
|
$cache->delete( $cache->makeKey( ApiQueryAllinfoboxes::MCACHE_KEY ) );
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue