From 804fecdd2f28ac28afd84cbd88283d54fe6fab6e Mon Sep 17 00:00:00 2001 From: PiBa-NL Date: Tue, 21 Mar 2017 00:13:33 +0100 Subject: pkg_call_plugins put includefile and supported plugins in the normal config.xml so there is no need to parse the package xml for them. this improves performance significantly for several pages like such as 'ipsec overview' and 'openvpn server edit page' which use certificates and gatewaygroups which acquire some information from plugins. --- src/etc/inc/pfsense-utils.inc | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'src/etc/inc/pfsense-utils.inc') diff --git a/src/etc/inc/pfsense-utils.inc b/src/etc/inc/pfsense-utils.inc index 81a2ea3..31ffe10 100644 --- a/src/etc/inc/pfsense-utils.inc +++ b/src/etc/inc/pfsense-utils.inc @@ -3134,19 +3134,15 @@ function pkg_call_plugins($plugin_type, $plugin_params) { return $results; } foreach ($config['installedpackages']['package'] as $package) { - if (!file_exists("/usr/local/pkg/" . $package['configurationfile'])) { - continue; - } - $pkg_config = parse_xml_config_pkg("/usr/local/pkg/" . $package['configurationfile'], 'packagegui'); - $pkgname = substr(reverse_strrchr($package['configurationfile'], "."), 0, -1); - if (is_array($pkg_config['plugins']['item'])) { - foreach ($pkg_config['plugins']['item'] as $plugin) { + if (is_array($package['plugins']['item'])) { + foreach ($package['plugins']['item'] as $plugin) { if ($plugin['type'] == $plugin_type) { - if (file_exists($pkg_config['include_file'])) { - require_once($pkg_config['include_file']); + if (file_exists($package['include_file'])) { + require_once($package['include_file']); } else { continue; } + $pkgname = substr(reverse_strrchr($package['configurationfile'], "."), 0, -1); $plugin_function = $pkgname . '_'. $plugin_type; $results[$pkgname] = call_user_func($plugin_function, $plugin_params); } -- cgit v1.1