From da4f78acb9b9d932423bf59a791554cf9552381b Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Sun, 21 Jan 2018 11:01:08 +0100 Subject: Move BigPipe::singleResponse() to Pagelet::flush() --- include/classes/BigPipe/Pagelet.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'include/classes/BigPipe/Pagelet.php') diff --git a/include/classes/BigPipe/Pagelet.php b/include/classes/BigPipe/Pagelet.php index ae465ab..101ec34 100644 --- a/include/classes/BigPipe/Pagelet.php +++ b/include/classes/BigPipe/Pagelet.php @@ -147,6 +147,24 @@ class Pagelet extends Item { ]; } + #=============================================================================== + # Flush pagelet immediately + #=============================================================================== + public function flush() { + if(BigPipe::enabled()) { + $pageletHTML = removeLineBreaksAndTabs($this->getHTML()); + $pageletHTML = str_replace('--', '--', $pageletHTML); + + $pageletJSON = json_encode($this->getStructure()); + + echo "\n"; + echo "\n\n"; + + BigPipe::dequeue($this); + BigPipe::flushOutputBuffer(); + } + } + #=============================================================================== # Magic method: __toString() #=============================================================================== -- cgit v1.2.3