mirror of
https://github.com/friendica/friendica
synced 2025-03-22 06:59:37 +00:00
Deprecate strategies via addons
This commit is contained in:
parent
e5416ca4a9
commit
1ea2df569e
2 changed files with 11 additions and 2 deletions
|
@ -54,11 +54,17 @@ class AddonLoader implements ICanLoadAddons
|
||||||
foreach ($config as $classname => $rule) {
|
foreach ($config as $classname => $rule) {
|
||||||
if ($classname === LoggerInterface::class) {
|
if ($classname === LoggerInterface::class) {
|
||||||
@trigger_error(sprintf(
|
@trigger_error(sprintf(
|
||||||
'Providing a strategy for `%s` is deprecated since 2025.02, please provide an implementation for `%s` via `dependency.config.php` instead in %s addon.',
|
'Providing a strategy for `%s` is deprecated since 2025.02 and will stop working in 5 months, please provide an implementation for `%s` via `dependency.config.php` and remove the `strategies.config.php` file in the `%s` addon.',
|
||||||
LoggerInterface::class,
|
$classname,
|
||||||
LoggerFactory::class,
|
LoggerFactory::class,
|
||||||
$addonName,
|
$addonName,
|
||||||
), \E_USER_DEPRECATED);
|
), \E_USER_DEPRECATED);
|
||||||
|
} else {
|
||||||
|
@trigger_error(sprintf(
|
||||||
|
'Providing strategies for `%s` via addons is deprecated since 2025.02 and will stop working in 5 months, please stop using this and remove the `strategies.config.php` file in the `%s` addon.',
|
||||||
|
$classname,
|
||||||
|
$addonName,
|
||||||
|
), \E_USER_DEPRECATED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,6 +81,9 @@ class StrategiesFileManager
|
||||||
throw new HookConfigException(sprintf('Error loading config file %s.', $configFile));
|
throw new HookConfigException(sprintf('Error loading config file %s.', $configFile));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated 2025.02 Providing strategies via addons is deprecated and will be removed in 5 months.
|
||||||
|
*/
|
||||||
$this->config = array_merge_recursive($config, $this->addonLoader->getActiveAddonConfig(static::CONFIG_NAME));
|
$this->config = array_merge_recursive($config, $this->addonLoader->getActiveAddonConfig(static::CONFIG_NAME));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue