summaryrefslogtreecommitdiffstats
path: root/src/etc/inc/pfsense-utils.inc
diff options
context:
space:
mode:
authorPiBa-NL <pba_2k3@yahoo.com>2017-03-21 00:13:33 +0100
committerPiBa-NL <pba_2k3@yahoo.com>2017-03-29 20:18:20 +0200
commit804fecdd2f28ac28afd84cbd88283d54fe6fab6e (patch)
tree8cc8eadda0666bb19a26bccefefb8cf43460fb25 /src/etc/inc/pfsense-utils.inc
parentfe255e99389cb6f75a06c55797890c52bd934f0f (diff)
downloadpfsense-804fecdd2f28ac28afd84cbd88283d54fe6fab6e.zip
pfsense-804fecdd2f28ac28afd84cbd88283d54fe6fab6e.tar.gz
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.
Diffstat (limited to 'src/etc/inc/pfsense-utils.inc')
-rw-r--r--src/etc/inc/pfsense-utils.inc14
1 files changed, 5 insertions, 9 deletions
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);
}
OpenPOWER on IntegriCloud