Skip to content

Commit

Permalink
Hook: allow hooks for old modules Web\Hooks
Browse files Browse the repository at this point in the history
refs #10613
  • Loading branch information
Thomas-Gelf committed Nov 13, 2015
1 parent dc3c787 commit a24bf32
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions library/Icinga/Application/Hook.php
Expand Up @@ -155,6 +155,20 @@ private static function assertValidHook($instance, $name)
}

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),
Expand Down

0 comments on commit a24bf32

Please sign in to comment.