From ac883e26528736c74f96b5bc692f685bdb25fd57 Mon Sep 17 00:00:00 2001 From: Michael Cullum Date: Sat, 19 May 2012 19:57:02 +0100 Subject: [PATCH] [ticket/10631] Remove the now un-used method PHPBB3-10631 --- phpBB/includes/extension/manager.php | 65 ---------------------------- 1 file changed, 65 deletions(-) diff --git a/phpBB/includes/extension/manager.php b/phpBB/includes/extension/manager.php index 2eebebf9b2..287e3828f9 100644 --- a/phpBB/includes/extension/manager.php +++ b/phpBB/includes/extension/manager.php @@ -464,68 +464,3 @@ class phpbb_extension_manager { return new phpbb_extension_finder($this, $this->phpbb_root_path, $this->cache, $this->php_ext, $this->cache_name . '_finder'); } - - /** - * Gets and processes the contents of the composer.json file. - * - * TODO: Add authors, fix it - * - * @param string $name Extension name to check - * @return array All the existing metadata keys - */ - public function get_meta_data($name) - { - // Find out where the composer.json is - $ext_filepath = get_extension_path($name); - $md_filepath = $phpbb_root_path . $ext_filepath . '/composer.json'; - - // Read the composer.json and decode it - $metadatafile = file_get_contents($filepath); - $metadata = json_decode($metadatafile, true); - - // What keys are required - $required_md_keys = array( - $metadata['name'], - $metadata['type'], - $metadata['description'], - $metadata['version'], - $metadata['license'], - $medadata['require']['phpbb'], - $metadata['extra']['dispay-name'], - ); - - // Check for required keys and trigger and error if it doesn't exist - foreach ($required_md_keys as $md_key) - { - if (empty($md_key)) - { - trigger_error('Not all required items exist in the composer.json'); - } - else - { - $existing_required_keys += $md_key; - } - } - - // Which keys are optional - $optional_md_keys = array( - $metadata['require']['php'], - $metadata['time'], - $metadata['homepage'], - ); - - $existing_optional_keys = array(); - - foreach ($optional_md_keys as $md_key) - { - if (!empty($md_key)) - { - $existing_optional_keys += $md_key; - } - } - - $keys = array_merge($existing_optional_keys, $existing_required_keys); - - return $keys; - } -}