mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-10 05:18:52 +00:00
[ticket/11415] Send the extension base the finder rather than the manager
PHPBB3-11415
This commit is contained in:
parent
27b2bbb8ff
commit
f91f8666fd
2 changed files with 9 additions and 10 deletions
|
@ -27,8 +27,8 @@ class phpbb_extension_base implements phpbb_extension_interface
|
|||
/** @var ContainerInterface */
|
||||
protected $container;
|
||||
|
||||
/** @var phpbb_extension_manager */
|
||||
protected $extension_manager;
|
||||
/** @var phpbb_extension_finder */
|
||||
protected $finder;
|
||||
|
||||
/** @var phpbb_db_migrator */
|
||||
protected $migrator;
|
||||
|
@ -43,14 +43,14 @@ class phpbb_extension_base implements phpbb_extension_interface
|
|||
* Constructor
|
||||
*
|
||||
* @param ContainerInterface $container Container object
|
||||
* @param phpbb_extension_manager $extension_manager
|
||||
* @param phpbb_extension_finder $extension_finder
|
||||
* @param string $extension_name Name of this extension (from ext.manager)
|
||||
* @param string $extension_path Relative path to this extension
|
||||
*/
|
||||
public function __construct(ContainerInterface $container, phpbb_extension_manager $extension_manager, phpbb_db_migrator $migrator, $extension_name, $extension_path)
|
||||
public function __construct(ContainerInterface $container, phpbb_extension_finder $extension_finder, phpbb_db_migrator $migrator, $extension_name, $extension_path)
|
||||
{
|
||||
$this->container = $container;
|
||||
$this->extension_manager = $extension_manager;
|
||||
$this->extension_finder = $extension_finder;
|
||||
$this->migrator = $migrator;
|
||||
|
||||
$this->extension_name = $extension_name;
|
||||
|
@ -125,11 +125,10 @@ class phpbb_extension_base implements phpbb_extension_interface
|
|||
}
|
||||
|
||||
// Only have the finder search in this extension path directory
|
||||
$finder = $this->extension_manager->get_finder();
|
||||
$migrations = $finder
|
||||
$migrations = $this->extension_finder
|
||||
->extension_directory('/migrations')
|
||||
->find_from_extension($this->extension_name, $this->extension_path);
|
||||
$migrations = $finder->get_classes_from_files($migrations);
|
||||
$migrations = $this->extension_finder->get_classes_from_files($migrations);
|
||||
|
||||
return $migrations;
|
||||
}
|
||||
|
|
|
@ -137,11 +137,11 @@ class phpbb_extension_manager
|
|||
|
||||
if (class_exists($extension_class_name))
|
||||
{
|
||||
return new $extension_class_name($this->container, $this, $migrator, $name, $this->get_extension_path($name, true));
|
||||
return new $extension_class_name($this->container, $this->get_finder(), $migrator, $name, $this->get_extension_path($name, true));
|
||||
}
|
||||
else
|
||||
{
|
||||
return new phpbb_extension_base($this->container, $this, $migrator, $name, $this->get_extension_path($name, true));
|
||||
return new phpbb_extension_base($this->container, $this->get_finder(), $migrator, $name, $this->get_extension_path($name, true));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue