diff options
author | Andrew Dolgov <[email protected]> | 2016-08-11 15:01:01 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2016-08-11 15:01:01 +0300 |
commit | 5cbd1fe8e4d9a67b002a681ab6bc2bc3ab60c628 (patch) | |
tree | 6691d8ec96323c9ad37ceb14485f6fb4f4f97194 /include/functions.php | |
parent | d39a2f8005ba69f2940c8e3b547fbb18dc23bef0 (diff) |
perform housekeeping tasks for plugins loaded in user-context only
Diffstat (limited to 'include/functions.php')
-rwxr-xr-x | include/functions.php | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/include/functions.php b/include/functions.php index 3ccc09d75..3902ac45a 100755 --- a/include/functions.php +++ b/include/functions.php @@ -833,14 +833,17 @@ return $csrf_token == $_SESSION['csrf_token']; } - function load_user_plugins($owner_uid) { + function load_user_plugins($owner_uid, $pluginhost = false) { + + if (!$pluginhost) $pluginhost = PluginHost::getInstance(); + if ($owner_uid && SCHEMA_VERSION >= 100) { $plugins = get_pref("_ENABLED_PLUGINS", $owner_uid); - PluginHost::getInstance()->load($plugins, PluginHost::KIND_USER, $owner_uid); + $pluginhost->load($plugins, PluginHost::KIND_USER, $owner_uid); if (get_schema_version() > 100) { - PluginHost::getInstance()->load_data(); + $pluginhost->load_data(); } } } |