]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Flush output buffers before running 'arc'
authorepriestley <git@epriestley.com>
Sat, 16 Jul 2011 15:09:47 +0000 (08:09 -0700)
committerepriestley <git@epriestley.com>
Sat, 16 Jul 2011 15:09:47 +0000 (08:09 -0700)
Summary: See D589. Some environments configure output buffering with a prepend script. This is rather silly, but we can at least recover from it.

Test Plan: Started multiple output buffers with ob_start() and then used phutil_console_confirm() to create a prompt. Verified that 'arc' was broken under output buffering prior to the patch, but now works correctly.

Reviewed By: dreuss

scripts/__init_script__.php

index 7ebd0c28538ddfc320b0907cf847cc56cf18ce33..587052054576eab1cd6d90425722b6c2d1e8b61c 100644 (file)
@@ -26,3 +26,9 @@ if (!@constant('__LIBPHUTIL__')) {
 }
 
 phutil_load_library(dirname(__FILE__).'/../src/');
+
+// There may be some kind of auto-prepend script configured which starts an
+// output buffer. Discard any such output buffers.
+while (ob_get_level() > 0) {
+  ob_end_clean();
+}