diff options
| author | 2021-01-04 17:59:36 -0500 | |
|---|---|---|
| committer | 2021-01-04 23:59:36 +0100 | |
| commit | 9aa3c038443a0807032d10657f841c8de0eb78d8 (patch) | |
| tree | 02e1a3b2f4ad553321a726a17222805fd25a21a1 /lib | |
| parent | 739080ff104786f5816ae96d98289e3e7f55b6b9 (diff) | |
Add a deprecation log error for extensions (#3335)
Extensions must override some parent methods. The rule is just a
guideline because only described in comments. The idea is to
deprecate that flexibility and add it to the code. To warn users
beforehand, we log error message regarding incomplete extensions.
See #3333
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/Minz/ExtensionManager.php | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Minz/ExtensionManager.php b/lib/Minz/ExtensionManager.php index b2814e4a3..e24c6c30b 100644 --- a/lib/Minz/ExtensionManager.php +++ b/lib/Minz/ExtensionManager.php @@ -172,6 +172,14 @@ class Minz_ExtensionManager { '` is not an instance of `Minz_Extension`'); return null; } + $reflector = new ReflectionClass($extension); + $className = $reflector->getName(); + if ('Minz_Extension' === $reflector->getMethod('handleConfigureAction')->class || + 'Minz_Extension' === $reflector->getMethod('install')->class || + 'Minz_Extension' === $reflector->getMethod('init')->class || + 'Minz_Extension' === $reflector->getMethod('uninstall')->class) { + Minz_Log::error("The '{$className}' extension class definition is deprecated. It will continue to work with the current version but will break in the future. The '{$className}' extension class needs to override the 'handleConfigurationAction' method, the 'install' method, the 'init' method, and the 'uninstall' method to work properly."); + } return $extension; } |
