mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-26 09:19:22 +02:00
Allow hooks to be prefixed with HOOK_
This commit is contained in:
parent
f43a5d1221
commit
3ef53aff6c
@ -152,6 +152,10 @@ class Plugins {
|
||||
foreach(self::getAllPluginsJson() as $plugin) {
|
||||
if (isset($plugin['hooks'])) {
|
||||
foreach ($plugin['hooks'] as $_name => $info) {
|
||||
if (str_contains($info['type'], 'HOOK_')) {
|
||||
$info['type'] = str_replace('HOOK_', '', $info['type']);
|
||||
}
|
||||
|
||||
if (defined('HOOK_'. $info['type'])) {
|
||||
$hook = constant('HOOK_'. $info['type']);
|
||||
$hooks[] = ['name' => $_name, 'type' => $hook, 'file' => $info['file']];
|
||||
|
Loading…
x
Reference in New Issue
Block a user