1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-11 03:04:09 +02:00

Merge PR #1308 branch 'nickvergessen/ticket/11450' into develop

# By Joas Schilling
# Via Joas Schilling
* nickvergessen/ticket/11450:
  [ticket/11450] Limit scopes of filters and add better docs
  [ticket/11450] Use helpers to copy/remove files
  [ticket/11450] Move mocked class into mock/metadata_manager.php
  [ticket/11450] Add new line at end of file
  [ticket/11450] Fix tests class name
  [ticket/11450] Require db_tools file to be included
  [ticket/11450] Add test for unexisting composer.json
  [ticket/11450] Test the extensions details page in ACP Customise Tab
  [ticket/11450] Fix all instances of phpbb_extension_metadata_manager
  [ticket/11450] Fix doc blocks and add missing class var $config
  [ticket/11450] Sort parameters alphabetically
  [ticket/11450] Remove unused $db and $phpEx from metadata_manager construct()
This commit is contained in:
Oleg Pudeyev
2013-05-08 08:17:39 -04:00
7 changed files with 209 additions and 34 deletions

View File

@@ -54,7 +54,7 @@ class acp_extensions
// If they've specified an extension, let's load the metadata manager and validate it.
if ($ext_name)
{
$md_manager = new phpbb_extension_metadata_manager($ext_name, $db, $phpbb_extension_manager, $phpbb_root_path, $phpEx, $template, $config);
$md_manager = new phpbb_extension_metadata_manager($ext_name, $config, $phpbb_extension_manager, $template, $phpbb_root_path);
try
{

View File

@@ -155,7 +155,7 @@ class phpbb_extension_manager
*/
public function create_extension_metadata_manager($name, phpbb_template $template)
{
return new phpbb_extension_metadata_manager($name, $this->db, $this, $this->phpbb_root_path, $this->php_ext, $template, $this->config);
return new phpbb_extension_metadata_manager($name, $this->config, $this, $template, $this->phpbb_root_path);
}
/**

View File

@@ -22,31 +22,64 @@ if (!defined('IN_PHPBB'))
*/
class phpbb_extension_metadata_manager
{
protected $phpEx;
/**
* phpBB Config instance
* @var phpbb_config
*/
protected $config;
/**
* phpBB Extension Manager
* @var phpbb_extension_manager
*/
protected $extension_manager;
protected $db;
protected $phpbb_root_path;
/**
* phpBB Template instance
* @var phpbb_template
*/
protected $template;
/**
* phpBB root path
* @var string
*/
protected $phpbb_root_path;
/**
* Name (including vendor) of the extension
* @var string
*/
protected $ext_name;
/**
* Metadata from the composer.json file
* @var array
*/
protected $metadata;
/**
* Link (including root path) to the metadata file
* @var string
*/
protected $metadata_file;
/**
* Creates the metadata manager
*
* @param phpbb_db_driver $db A database connection
* @param string $extension_manager An instance of the phpbb extension manager
* @param string $phpbb_root_path Path to the phpbb includes directory.
* @param string $phpEx php file extension
* @param string $ext_name Name (including vendor) of the extension
* @param phpbb_config $config phpBB Config instance
* @param phpbb_extension_manager $extension_manager An instance of the phpBBb extension manager
* @param phpbb_template $template phpBB Template instance
* @param string $phpbb_root_path Path to the phpbb includes directory.
*/
public function __construct($ext_name, phpbb_db_driver $db, phpbb_extension_manager $extension_manager, $phpbb_root_path, $phpEx = 'php', phpbb_template $template, phpbb_config $config)
public function __construct($ext_name, phpbb_config $config, phpbb_extension_manager $extension_manager, phpbb_template $template, $phpbb_root_path)
{
$this->phpbb_root_path = $phpbb_root_path;
$this->db = $db;
$this->config = $config;
$this->phpEx = $phpEx;
$this->template = $template;
$this->extension_manager = $extension_manager;
$this->template = $template;
$this->phpbb_root_path = $phpbb_root_path;
$this->ext_name = $ext_name;
$this->metadata = array();
$this->metadata_file = '';