mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 22:28:51 +00:00
[ticket/10631] Remove the now un-used method
PHPBB3-10631
This commit is contained in:
parent
a0e283d7b0
commit
ac883e2652
1 changed files with 0 additions and 65 deletions
|
@ -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');
|
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue