More buffer flush while printing unsorted lists
--- a/labs/tripPlannerTester.kml.php
+++ b/labs/tripPlannerTester.kml.php
@@ -159,8 +159,7 @@
$regionTimes[] = $time;
}
}
- flush();
- ob_flush();
+ flush(); @ob_flush();
curl_close($ch);
}
}
--- a/stop.php
+++ b/stop.php
@@ -95,6 +95,7 @@
echo '</p>';
echo '<p class="ui-li-aside"><strong>' . midnight_seconds_to_time($row[0]) . '</strong></p>';
echo '</a></li>';
+ flush(); @ob_flush();
}
if (sizeof($trips) == 0) echo "<li> <center>No trips in the near future.</center> </li>";
echo '</ul></div>';
--- a/stopList.php
+++ b/stopList.php
@@ -31,6 +31,7 @@
foreach ($suburbs as $suburb) {
if (startsWith($suburb, $_REQUEST['firstLetter'])) {
echo '<li><a href="stopList.php?suburb=' . urlencode($suburb) . '">' . $suburb . '</a></li>';
+ flush(); @ob_flush();
}
}
}
@@ -101,6 +102,7 @@
}
echo bracketsMeanNewLine(trim(preg_replace("/\(Platform.*/", "", $row[1])) . '(' . sizeof($stopsGrouped["stop_ids"]) . ' stops)');
echo "</a></li>\n";
+ flush(); @ob_flush();
$stopsGrouped = Array();
}
else {
@@ -113,6 +115,7 @@
}
echo bracketsMeanNewLine($row[1]);
echo "</a></li>\n";
+ flush(); @ob_flush();
}
}
else {
--- a/trip.php
+++ b/trip.php
@@ -40,12 +40,14 @@
foreach ($routetrips as $othertrip) {
echo '<a href="trip.php?tripid=' . $othertrip[1] . "&routeid=" . $routeid . '">' . midnight_seconds_to_time($othertrip[0]) . '</a> ';
}
+flush(); @ob_flush();
echo '</p><p><h2>Other directions/timing periods:</h2> ';
$url = $APIurl . "/json/routesearch?routeshortname=" . rawurlencode($trips[1]->route_short_name);
$json = json_decode(getPage($url));
foreach ($json as $row) {
if ($row[0] != $routeid) echo '<a href="trip.php?routeid=' . $row[0] . '">' . $row[2] . ' (' . ucwords($row[3]) . ')</a> ';
}
+flush(); @ob_flush();
echo ' <ul data-role="listview" data-inset="true">';
echo '<li data-role="list-divider">' . midnight_seconds_to_time($times[0]) . '-' . midnight_seconds_to_time($times[sizeof($times) - 1]) . ' ' . $trips[1]->route_long_name . '</li>';
$stopsGrouped = Array();
@@ -62,6 +64,7 @@
echo '<p class="ui-li-aside">' . midnight_seconds_to_time($stopsGrouped['startTime']) . ' to ' . midnight_seconds_to_time($stopsGrouped['endTime']) . '</p>';
echo bracketsMeanNewLine($row[1]);
echo '</a></li>';
+ flush(); @ob_flush();
$stopsGrouped = Array();
}
else {
@@ -70,6 +73,7 @@
echo '<p class="ui-li-aside">' . midnight_seconds_to_time($times[$key]) . '</p>';
echo bracketsMeanNewLine($row[1]);
echo '</a></li>';
+ flush(); @ob_flush();
}
}
else {
--- a/tripPlanner.php
+++ b/tripPlanner.php
@@ -62,6 +62,7 @@
echo '<li>';
processLeg($legNumber, $leg);
echo "</li>";
+ flush(); @ob_flush();
}
echo "</ul>";
}