[ticket/10631] Remove the now un-used method

PHPBB3-10631
This commit is contained in:
Michael Cullum 2012-05-19 19:57:02 +01:00 committed by Unknown Bliss
parent a0e283d7b0
commit ac883e2652

View file

@ -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;
}
}