aboutsummaryrefslogtreecommitdiffstats
path: root/config/openbgpd/openbgpd_status.php
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2012-11-26 23:59:33 +0100
committerErmal <eri@pfsense.org>2012-11-26 23:59:33 +0100
commit2b561e0abff20b33dd1e94c2809e4cb1caae488e (patch)
tree03a10459f7b1615587e9aa939f5d176864a54db0 /config/openbgpd/openbgpd_status.php
parent762e1f4919c433e0b14f2a653ebfdb96d4ad960e (diff)
downloadpfsense-packages-2b561e0abff20b33dd1e94c2809e4cb1caae488e.tar.gz
pfsense-packages-2b561e0abff20b33dd1e94c2809e4cb1caae488e.tar.bz2
pfsense-packages-2b561e0abff20b33dd1e94c2809e4cb1caae488e.zip
Use popen here to not reach php memory limits
Diffstat (limited to 'config/openbgpd/openbgpd_status.php')
-rw-r--r--config/openbgpd/openbgpd_status.php11
1 files changed, 3 insertions, 8 deletions
diff --git a/config/openbgpd/openbgpd_status.php b/config/openbgpd/openbgpd_status.php
index b493236f..4547018a 100644
--- a/config/openbgpd/openbgpd_status.php
+++ b/config/openbgpd/openbgpd_status.php
@@ -59,14 +59,9 @@ function doCmdT($title, $command) {
}
fclose($fd);
} else {
- $execOutput = "";
- $execStatus = "";
- exec ($command . " 2>&1", $execOutput, $execStatus);
- for ($i = 0; isset($execOutput[$i]); $i++) {
- if ($i > 0) {
- echo "\n";
- }
- echo htmlspecialchars($execOutput[$i],ENT_NOQUOTES);
+ $fd = popen("{$command} 2>&1", "r");
+ while (($line = fgets($fd)) !== FALSE) {
+ echo htmlspecialchars($line, ENT_NOQUOTES);
}
}
echo "</pre></tr>\n";