@@ -491,6 +491,10 @@ public function getOutput()
491
491
*/
492
492
public function getIncrementalOutput ()
493
493
{
494
+ if ($ this ->outputDisabled ) {
495
+ throw new LogicException ('Output has been disabled. ' );
496
+ }
497
+
494
498
$ this ->requireProcessIsStarted (__FUNCTION__ );
495
499
496
500
$ latest = stream_get_contents ($ this ->stdout , -1 , $ this ->incrementalOutputOffset );
@@ -510,7 +514,8 @@ public function getIncrementalOutput()
510
514
*/
511
515
public function clearOutput ()
512
516
{
513
- $ this ->stdout = '' ;
517
+ ftruncate ($ this ->stdout , 0 );
518
+ fseek ($ this ->stdout , 0 );
514
519
$ this ->incrementalOutputOffset = 0 ;
515
520
516
521
return $ this ;
@@ -555,6 +560,10 @@ public function getErrorOutput()
555
560
*/
556
561
public function getIncrementalErrorOutput ()
557
562
{
563
+ if ($ this ->outputDisabled ) {
564
+ throw new LogicException ('Output has been disabled. ' );
565
+ }
566
+
558
567
$ this ->requireProcessIsStarted (__FUNCTION__ );
559
568
560
569
$ latest = stream_get_contents ($ this ->stderr , -1 , $ this ->incrementalErrorOutputOffset );
@@ -574,7 +583,8 @@ public function getIncrementalErrorOutput()
574
583
*/
575
584
public function clearErrorOutput ()
576
585
{
577
- $ this ->stderr = '' ;
586
+ ftruncate ($ this ->stderr , 0 );
587
+ fseek ($ this ->stderr , 0 );
578
588
$ this ->incrementalErrorOutputOffset = 0 ;
579
589
580
590
return $ this ;
0 commit comments