diff options
Diffstat (limited to 'application/plugin/PluginManager.php')
-rw-r--r-- | application/plugin/PluginManager.php | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/application/plugin/PluginManager.php b/application/plugin/PluginManager.php index f7b24a8e..2d93cb3a 100644 --- a/application/plugin/PluginManager.php +++ b/application/plugin/PluginManager.php | |||
@@ -16,7 +16,7 @@ class PluginManager | |||
16 | * | 16 | * |
17 | * @var array $authorizedPlugins | 17 | * @var array $authorizedPlugins |
18 | */ | 18 | */ |
19 | private $authorizedPlugins; | 19 | private $authorizedPlugins = []; |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * List of loaded plugins. | 22 | * List of loaded plugins. |
@@ -108,11 +108,20 @@ class PluginManager | |||
108 | $data['_LOGGEDIN_'] = $params['loggedin']; | 108 | $data['_LOGGEDIN_'] = $params['loggedin']; |
109 | } | 109 | } |
110 | 110 | ||
111 | if (isset($params['basePath'])) { | ||
112 | $data['_BASE_PATH_'] = $params['basePath']; | ||
113 | } | ||
114 | |||
111 | foreach ($this->loadedPlugins as $plugin) { | 115 | foreach ($this->loadedPlugins as $plugin) { |
112 | $hookFunction = $this->buildHookName($hook, $plugin); | 116 | $hookFunction = $this->buildHookName($hook, $plugin); |
113 | 117 | ||
114 | if (function_exists($hookFunction)) { | 118 | if (function_exists($hookFunction)) { |
115 | $data = call_user_func($hookFunction, $data, $this->conf); | 119 | try { |
120 | $data = call_user_func($hookFunction, $data, $this->conf); | ||
121 | } catch (\Throwable $e) { | ||
122 | $error = $plugin . t(' [plugin incompatibility]: ') . $e->getMessage(); | ||
123 | $this->errors = array_unique(array_merge($this->errors, [$error])); | ||
124 | } | ||
116 | } | 125 | } |
117 | } | 126 | } |
118 | } | 127 | } |