Hook: allow hooks for old modules Web\Hooks

refs #10613
This commit is contained in:
Thomas Gelf 2015-11-12 18:30:18 +01:00
parent dc3c787446
commit a24bf32c5b
1 changed files with 14 additions and 0 deletions

View File

@ -155,6 +155,20 @@ class Hook
}
if (!$instance instanceof $base_class) {
// This is a compatibility check. Should be removed one far day:
if ($module !== null) {
$compat_class = 'Icinga\\Module\\'
. ucfirst($module)
. '\\Web\\Hook\\'
. ucfirst($name)
. $suffix;
if ($instance instanceof $compat_class) {
return;
}
}
throw new ProgrammingError(
'%s is not an instance of %s',
get_class($instance),