summaryrefslogtreecommitdiffstats
path: root/etc/inc
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2010-05-21 19:44:42 +0000
committerErmal <eri@pfsense.org>2010-05-21 19:44:42 +0000
commite51cf5960f6718a14c07daa7b6e96337fdba1f0e (patch)
tree199c254401e65fd697d7796ddebd4d2e0e19a9b4 /etc/inc
parentde792e62e30ac90d0d5d96f119681c86836a366f (diff)
downloadpfsense-e51cf5960f6718a14c07daa7b6e96337fdba1f0e.zip
pfsense-e51cf5960f6718a14c07daa7b6e96337fdba1f0e.tar.gz
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.
Diffstat (limited to 'etc/inc')
-rw-r--r--etc/inc/filter.inc6
-rw-r--r--etc/inc/gwlb.inc14
-rw-r--r--etc/inc/system.inc4
3 files changed, 12 insertions, 12 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc
index f01faee..b842073 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;
- $a_gateways = return_gateways_array();
- foreach ($a_gateways as $gateway) {
+ global $config, $gateways_arr;
+ $gateways_arr = return_gateways_array();
+ foreach ($gateways_arr 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 80cfc40..7e2c021 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;
+ global $config, $gateways_arr;
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;
+ global $config, $gateways_arr;
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;
+ global $config, $gateways_arr;
$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;
+ global $config, $g, $gateways_arr;
/* 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;
+ global $config, $gateways_arr;
$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;
+ global $config, $gateways_arr;
$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;
+ global $config, $gateways_arr;
$gateways_arr = return_gateways_array();
if (!empty($gateways_arr[$name])) {
diff --git a/etc/inc/system.inc b/etc/inc/system.inc
index 6281a14..45a8e8c 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;
+ global $config, $g, $gateways_arr;
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
+?>
OpenPOWER on IntegriCloud