mirror of
https://git.friendi.ca/friendica/friendica.git
synced 2025-06-07 20:44:32 +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 CONFIG_NAME = 'strategies';
|
||||
|
||||
private AddonHelper $addonHelper;
|
||||
private IManageConfigValues $configuration;
|
||||
protected array $config = [];
|
||||
/** @var string */
|
||||
protected $basePath;
|
||||
|
||||
public function __construct(string $basePath, AddonHelper $addonHelper)
|
||||
public function __construct(string $basePath, IManageConfigValues $configuration)
|
||||
{
|
||||
$this->basePath = $basePath;
|
||||
$this->addonHelper = $addonHelper;
|
||||
$this->basePath = $basePath;
|
||||
$this->configuration = $configuration;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -96,15 +96,13 @@ class StrategiesFileManager
|
|||
*/
|
||||
private function getActiveAddonConfig(string $configName): array
|
||||
{
|
||||
$this->addonHelper->loadAddons();
|
||||
|
||||
$addons = $this->addonHelper->getEnabledAddons();
|
||||
$addons = array_keys(array_filter($this->configuration->get('addons') ?? []));
|
||||
$returnConfig = [];
|
||||
|
||||
foreach ($addons as $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)) {
|
||||
// Addon unmodified, skipping
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue