mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-16 17:44:41 +00:00
plugins: do not call write_config() in plugins_interfaces()
Since we weaved the latter into the former, we can now get rid of the transition code. The behaviour doesn't change.
This commit is contained in:
parent
143e759f00
commit
927f4e0efe
@ -179,7 +179,7 @@ function write_config($desc = '', $backup = true)
|
||||
|
||||
if (function_exists('plugins_interfaces')) {
|
||||
/* only pull plugins if plugins.inc was included before */
|
||||
plugins_interfaces(false);
|
||||
plugins_interfaces();
|
||||
}
|
||||
|
||||
$cnf = OPNsense\Core\Config::getInstance();
|
||||
|
||||
@ -94,12 +94,11 @@ function plugins_syslog()
|
||||
* Every <plugin>_interface should return a named array containing the interface unique identifier and properties.
|
||||
*
|
||||
*/
|
||||
function plugins_interfaces($write_allowed = true)
|
||||
function plugins_interfaces()
|
||||
{
|
||||
global $config;
|
||||
|
||||
$stale_interfaces = array();
|
||||
$write_required = false;
|
||||
|
||||
// mark previous dynamic registrations stale
|
||||
if (isset($config['interfaces'])) {
|
||||
@ -135,7 +134,6 @@ function plugins_interfaces($write_allowed = true)
|
||||
foreach ($intf_data as $prop_name => $prop_value) {
|
||||
if ((empty($intf_config[$prop_name]) && !empty($prop_value)) || $intf_config[$prop_name] != $prop_value) {
|
||||
$intf_config[$prop_name] = $prop_value;
|
||||
$write_required = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -147,14 +145,8 @@ function plugins_interfaces($write_allowed = true)
|
||||
foreach ($stale_interfaces as $intf_ref => $no_data) {
|
||||
if (isset($config['interfaces'][$intf_ref])) {
|
||||
unset($config['interfaces'][$intf_ref]);
|
||||
$write_required = true;
|
||||
}
|
||||
}
|
||||
|
||||
// configuration changed, materialize
|
||||
if ($write_allowed && $write_required) {
|
||||
write_config();
|
||||
}
|
||||
}
|
||||
|
||||
function plugins_configure()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user