mirror of
https://git.friendi.ca/friendica/friendica.git
synced 2025-06-08 04:14:27 +02:00
Do not use AddonHelper in StrategiesFileManager
to avoid circular dependendy with strategies ans cache
This commit is contained in:
parent
59d22b87af
commit
d00fc89a59
1 changed files with 6 additions and 8 deletions
|
@ -30,15 +30,15 @@ class StrategiesFileManager
|
||||||
const STATIC_DIR = 'static';
|
const STATIC_DIR = 'static';
|
||||||
const CONFIG_NAME = 'strategies';
|
const CONFIG_NAME = 'strategies';
|
||||||
|
|
||||||
private AddonHelper $addonHelper;
|
private IManageConfigValues $configuration;
|
||||||
protected array $config = [];
|
protected array $config = [];
|
||||||
/** @var string */
|
/** @var string */
|
||||||
protected $basePath;
|
protected $basePath;
|
||||||
|
|
||||||
public function __construct(string $basePath, AddonHelper $addonHelper)
|
public function __construct(string $basePath, IManageConfigValues $configuration)
|
||||||
{
|
{
|
||||||
$this->basePath = $basePath;
|
$this->basePath = $basePath;
|
||||||
$this->addonHelper = $addonHelper;
|
$this->configuration = $configuration;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -96,15 +96,13 @@ class StrategiesFileManager
|
||||||
*/
|
*/
|
||||||
private function getActiveAddonConfig(string $configName): array
|
private function getActiveAddonConfig(string $configName): array
|
||||||
{
|
{
|
||||||
$this->addonHelper->loadAddons();
|
$addons = array_keys(array_filter($this->configuration->get('addons') ?? []));
|
||||||
|
|
||||||
$addons = $this->addonHelper->getEnabledAddons();
|
|
||||||
$returnConfig = [];
|
$returnConfig = [];
|
||||||
|
|
||||||
foreach ($addons as $addon) {
|
foreach ($addons as $addon) {
|
||||||
$addonName = Strings::sanitizeFilePathItem(trim($addon));
|
$addonName = Strings::sanitizeFilePathItem(trim($addon));
|
||||||
|
|
||||||
$configFile = $this->addonHelper->getAddonPath() . '/' . $addonName . '/' . static::STATIC_DIR . '/' . $configName . '.config.php';
|
$configFile = $this->basePath . '/addon/' . $addonName . '/' . static::STATIC_DIR . '/' . $configName . '.config.php';
|
||||||
|
|
||||||
if (!file_exists($configFile)) {
|
if (!file_exists($configFile)) {
|
||||||
// Addon unmodified, skipping
|
// Addon unmodified, skipping
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue