diff options
author | Ermal <eri@pfsense.org> | 2010-05-21 20:45:57 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2010-05-21 20:45:57 +0000 |
commit | 962625aa412ad9dc9b18aeefd1db77eac9e14e7b (patch) | |
tree | ac9bbcf41db0f1894240eb982e5331d74a755e80 /etc/inc | |
parent | e51cf5960f6718a14c07daa7b6e96337fdba1f0e (diff) | |
download | pfsense-962625aa412ad9dc9b18aeefd1db77eac9e14e7b.zip pfsense-962625aa412ad9dc9b18aeefd1db77eac9e14e7b.tar.gz |
Revert "Use a global array for the most part of using the return_gateways_array() function in the backend which should lower the memory allocated/cached by php a lot."
This reverts commit e51cf5960f6718a14c07daa7b6e96337fdba1f0e.
Diffstat (limited to 'etc/inc')
-rw-r--r-- | etc/inc/filter.inc | 6 | ||||
-rw-r--r-- | etc/inc/gwlb.inc | 14 | ||||
-rw-r--r-- | etc/inc/system.inc | 4 |
3 files changed, 12 insertions, 12 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc index b842073..f01faee 100644 --- a/etc/inc/filter.inc +++ b/etc/inc/filter.inc @@ -141,9 +141,9 @@ function filter_configure() { } function delete_states_for_down_gateways() { - global $config, $gateways_arr; - $gateways_arr = return_gateways_array(); - foreach ($gateways_arr as $gateway) { + global $config; + $a_gateways = return_gateways_array(); + foreach ($a_gateways as $gateway) { if($gateway['monitor'] == "down") { $int_ip = get_interface_ip($gateway['interface']); if($int_ip) diff --git a/etc/inc/gwlb.inc b/etc/inc/gwlb.inc index 7e2c021..80cfc40 100644 --- a/etc/inc/gwlb.inc +++ b/etc/inc/gwlb.inc @@ -34,7 +34,7 @@ * creates monitoring configuration file */ function setup_gateways_monitor() { - global $config, $gateways_arr; + global $config; global $g; $gateways_arr = return_gateways_array(); if (!is_array($config['gateways']['gateway_item'])) @@ -243,7 +243,7 @@ EOD; /* return the status of the apinger targets as a array */ function return_gateways_status() { - global $config, $gateways_arr; + global $config; global $g; $gateways_arr = return_gateways_array(); @@ -282,7 +282,7 @@ function return_gateways_status() { /* Return all configured gateways on the system */ function return_gateways_array($disabled = false) { - global $config, $gateways_arr; + global $config; $gateways_arr = array(); @@ -365,7 +365,7 @@ function return_gateways_array($disabled = false) { * All gateway groups will be processed before returning the array. */ function return_gateway_groups_array() { - global $config, $g, $gateways_arr; + global $config, $g; /* fetch the current gateways status */ $gateways_status = return_gateways_status(); @@ -475,7 +475,7 @@ function dhclient_update_gateway_groups_defaultroute($interface = "wan") { } function lookup_gateway_ip_by_name($name) { - global $config, $gateways_arr; + global $config; $gateways_arr = return_gateways_array(); if (!empty($gateways_arr[$name])) { @@ -487,7 +487,7 @@ function lookup_gateway_ip_by_name($name) { } function lookup_gateway_monitor_ip_by_name($name) { - global $config, $gateways_arr; + global $config; $gateways_arr = return_gateways_array(); if (!empty($gateways_arr[$name])) { @@ -506,7 +506,7 @@ function lookup_gateway_monitor_ip_by_name($name) { } function lookup_gateway_interface_by_name($name) { - global $config, $gateways_arr; + global $config; $gateways_arr = return_gateways_array(); if (!empty($gateways_arr[$name])) { diff --git a/etc/inc/system.inc b/etc/inc/system.inc index 45a8e8c..6281a14 100644 --- a/etc/inc/system.inc +++ b/etc/inc/system.inc @@ -248,7 +248,7 @@ function system_hostname_configure() { } function system_routing_configure() { - global $config, $g, $gateways_arr; + global $config, $g; if(isset($config['system']['developerspew'])) { $mt = microtime(); echo "system_routing_configure() being called $mt\n"; @@ -1418,4 +1418,4 @@ function system_get_dmesg_boot() { return file_get_contents("{$g['varlog_path']}/dmesg.boot"); } -?> +?>
\ No newline at end of file |