From 4feb2ac7f2224d1216c4fb05b26ced3e25f85de9 Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Sat, 23 May 2015 23:05:10 +0200 Subject: [PATCH] Remove unused 'XMPGetInfo' and 'XMPGetResults' hooks These hooks are unused in all extensions in Gerrit. We need to remove them so we can move these classes into a separate library. Change-Id: I66406c642168adc703361b75deb95c830c1ddab1 --- docs/hooks.txt | 11 ----------- includes/media/XMP.php | 2 -- includes/media/XMPInfo.php | 7 ------- 3 files changed, 20 deletions(-) diff --git a/docs/hooks.txt b/docs/hooks.txt index d15f66d2e3..4fa92a8763 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -3285,16 +3285,5 @@ $obj: The XmlDumpWriter object. $row: The database row for the revision. $text: The revision text. -'XMPGetInfo': Called when obtaining the list of XMP tags to extract. Can be used -to add additional tags to extract. -&$items: Array containing information on which items to extract. See XMPInfo for - details on the format. - -'XMPGetResults': Called just before returning the results array of parsing xmp -data. Can be used to post-process the results. -&$data: Array of metadata sections (such as $data['xmp-general']) each section - is an array of metadata tags returned (each tag is either a value, or an array - of values). - More hooks might be available but undocumented, you can execute "php maintenance/findHooks.php" to find hidden ones. diff --git a/includes/media/XMP.php b/includes/media/XMP.php index 50f04ae9c7..5af31fa12d 100644 --- a/includes/media/XMP.php +++ b/includes/media/XMP.php @@ -195,8 +195,6 @@ class XMPReader { $data = $this->results; - Hooks::run( 'XMPGetResults', array( &$data ) ); - if ( isset( $data['xmp-special']['AuthorsPosition'] ) && is_string( $data['xmp-special']['AuthorsPosition'] ) && isset( $data['xmp-general']['Artist'][0] ) diff --git a/includes/media/XMPInfo.php b/includes/media/XMPInfo.php index e0a491cbcf..2a31001835 100644 --- a/includes/media/XMPInfo.php +++ b/includes/media/XMPInfo.php @@ -31,13 +31,6 @@ class XMPInfo { * @return array XMP item configuration array. */ public static function getItems() { - if ( !self::$ranHooks ) { - // This is for if someone makes a custom metadata extension. - // For example, a medical wiki might want to decode DICOM xmp properties. - Hooks::run( 'XMPGetInfo', array( &self::$items ) ); - self::$ranHooks = true; // Only want to do this once. - } - return self::$items; } -- 2.20.1