Jump to content

Manual:Hooks/ValidateExtendedMetadataCache

From mediawiki.org
ValidateExtendedMetadataCache
Available from version 1.23.0 (Gerrit change 78926)
Called to validate the cached metadata in FormatMetadata::getExtendedMeta (return false means cache will be invalidated and the GetExtendedMetadata hook will called again).
Define function:
public static function onValidateExtendedMetadataCache( $timestamp, File $file ) { ... }
Attach hook: In extension.json:
{
	"Hooks": {
		"ValidateExtendedMetadataCache": "MediaWiki\\Extension\\MyExtension\\Hooks::onValidateExtendedMetadataCache"
	}
}
Called from: File(s): media/FormatMetadata.php
Function(s): fetchExtendedMetadata
Interface: ValidateExtendedMetadataCacheHook.php

For more information about attaching hooks, see Manual:Hooks .
For examples of extensions using this hook, see Category:ValidateExtendedMetadataCache extensions.


Details

[edit]
  • $timestamp: The timestamp metadata was generated
  • $file: The file the metadata is for