From 60a237ac624e99f7066986f973b4fcbba05a5b49 Mon Sep 17 00:00:00 2001
From: Evan Prodromou <evan@status.net>
Date: Fri, 21 Jan 2011 14:23:02 -0500
Subject: [PATCH] some flushing in the UI

---
 lib/action.php       |  8 ++++++++
 lib/xmloutputter.php | 11 +++++++++++
 2 files changed, 19 insertions(+)

diff --git a/lib/action.php b/lib/action.php
index 20de71aec1..654ec7aa43 100644
--- a/lib/action.php
+++ b/lib/action.php
@@ -100,10 +100,12 @@ class Action extends HTMLOutputter // lawsuit
     {
         if (Event::handle('StartShowHTML', array($this))) {
             $this->startHTML();
+            $this->flush();
             Event::handle('EndShowHTML', array($this));
         }
         if (Event::handle('StartShowHead', array($this))) {
             $this->showHead();
+            $this->flush();
             Event::handle('EndShowHead', array($this));
         }
         if (Event::handle('StartShowBody', array($this))) {
@@ -471,11 +473,14 @@ class Action extends HTMLOutputter // lawsuit
         $this->elementStart('div', array('id' => 'wrap'));
         if (Event::handle('StartShowHeader', array($this))) {
             $this->showHeader();
+            $this->flush();
             Event::handle('EndShowHeader', array($this));
         }
         $this->showCore();
+        $this->flush();
         if (Event::handle('StartShowFooter', array($this))) {
             $this->showFooter();
+            $this->flush();
             Event::handle('EndShowFooter', array($this));
         }
         $this->elementEnd('div');
@@ -695,14 +700,17 @@ class Action extends HTMLOutputter // lawsuit
         $this->elementStart('div', array('id' => 'site_nav_local_views_wrapper'));
         if (Event::handle('StartShowLocalNavBlock', array($this))) {
             $this->showLocalNavBlock();
+            $this->flush();
             Event::handle('EndShowLocalNavBlock', array($this));
         }
         if (Event::handle('StartShowContentBlock', array($this))) {
             $this->showContentBlock();
+            $this->flush();
             Event::handle('EndShowContentBlock', array($this));
         }
         if (Event::handle('StartShowAside', array($this))) {
             $this->showAside();
+            $this->flush();
             Event::handle('EndShowAside', array($this));
         }
         $this->elementEnd('div');
diff --git a/lib/xmloutputter.php b/lib/xmloutputter.php
index 15b18e7d90..528f633050 100644
--- a/lib/xmloutputter.php
+++ b/lib/xmloutputter.php
@@ -242,4 +242,15 @@ class XMLOutputter
     {
         $this->xw->writeComment($txt);
     }
+
+    /**
+     * Flush output buffers
+     *
+     * @return void
+     */
+
+    function flush()
+    {
+        $this->xw->flush();
+    }
 }
-- 
2.39.5