]> git.mxchange.org Git - friendica.git/commitdiff
Deprecate strategies via addons
authorArt4 <art4@wlabs.de>
Fri, 7 Feb 2025 15:06:11 +0000 (15:06 +0000)
committerArt4 <art4@wlabs.de>
Fri, 7 Feb 2025 15:06:11 +0000 (15:06 +0000)
src/Core/Addon/Model/AddonLoader.php
src/Core/Hooks/Util/StrategiesFileManager.php

index 8ef27cb5a7083cce86463cd078292004ca13cecc..a608a66e3d845c3a20e473e805f2191efdfa2276 100644 (file)
@@ -54,11 +54,17 @@ class AddonLoader implements ICanLoadAddons
                                foreach ($config as $classname => $rule) {
                                        if ($classname === LoggerInterface::class) {
                                                @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.',
-                                                       LoggerInterface::class,
+                                                       '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.',
+                                                       $classname,
                                                        LoggerFactory::class,
                                                        $addonName,
                                                ), \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);
                                        }
                                }
                        }
index a39aabc85bd0b2d2c7abbfe44ee75170828b6ca4..f5d2fe0224d95bf4afa5d45fe4f11bb90e572db6 100644 (file)
@@ -81,6 +81,9 @@ class StrategiesFileManager
                        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));
        }
 }