/** * Stops output buffering, flushing everything to the browser * * @return void */ public static function stop() { if (!self::$started) { throw new fProgrammerException('Output buffering can not be stopped since it has not been started'); } if (self::$capturing) { throw new fProgrammerException('Output capturing is currently active and it must be stopped before buffering can be stopped'); } // Only flush if there is content to push out, otherwise // we might prevent headers from being sent if (ob_get_contents()) { ob_end_flush(); } else { ob_end_clean(); } self::$started = FALSE; }