@@ -610,26 +610,51 @@ public function stop($timeout=10)
610
610
return $ this ->exitcode ;
611
611
}
612
612
613
+ /**
614
+ * Adds a line to the STDOUT stream
615
+ *
616
+ * @param string $line The line to append
617
+ */
613
618
public function addOutput ($ line )
614
619
{
615
620
$ this ->stdout .= $ line ;
616
621
}
617
622
623
+ /**
624
+ * Adds a line to the STDERR stream
625
+ *
626
+ * @param string $line The line to append
627
+ */
618
628
public function addErrorOutput ($ line )
619
629
{
620
630
$ this ->stderr .= $ line ;
621
631
}
622
632
633
+ /**
634
+ * Gets the command line to be executed
635
+ *
636
+ * @return string The command to execute
637
+ */
623
638
public function getCommandLine ()
624
639
{
625
640
return $ this ->commandline ;
626
641
}
627
642
643
+ /**
644
+ * Sets the command line to be executed
645
+ *
646
+ * @param string $commandline The command to execute
647
+ */
628
648
public function setCommandLine ($ commandline )
629
649
{
630
650
$ this ->commandline = $ commandline ;
631
651
}
632
652
653
+ /**
654
+ * Gets the process timeout
655
+ *
656
+ * @return integer|null The timeout in seconds or null if it's disabled
657
+ */
10000
div>
633
658
public function getTimeout ()
634
659
{
635
660
return $ this ->timeout ;
@@ -640,7 +665,9 @@ public function getTimeout()
640
665
*
641
666
* To disable the timeout, set this value to null.
642
667
*
643
- * @param integer|null
668
+ * @param integer|null $timeout The timeout in seconds
669
+ *
670
+ * @throws \InvalidArgumentException if the timeout is negative
644
671
*/
645
672
public function setTimeout ($ timeout )
646
673
{
@@ -659,51 +686,103 @@ public function setTimeout($timeout)
659
686
$ this ->timeout = $ timeout ;
660
687
}
661
688
689
+ /**
690
+ * Gets the working directory
691
+ *
692
+ * @return string The current working directory
693
+ */
662
694
public function getWorkingDirectory ()
663
695
{
664
696
return $ this ->cwd ;
665
697
}
666
698
699
+ /**
700
+ * Sets the current working directory
701
+ *
702
+ * @param string $cwd The new working directory
703
+ */
667
704
public function setWorkingDirectory ($ cwd )
668
705
{
669
706
$ this ->cwd = $ cwd ;
670
707
}
671
708
709
+ /**
710
+ * Gets the environment variables
711
+ *
712
+ * @return array The current environment variables
713
+ */
672
714
public function getEnv ()
673
715
{
674
716
return $ this ->env ;
675
717
}
676
718
719
+ /**
720
+ * Sets the environment variables
721
+ *
722
+ * @param array $env The new environment variables
723
+ */
677
724
public function setEnv (array $ env )
678
725
{
679
726
$ this ->env = $ env ;
680
727
}
681
728
729
+ /**
730
+ * Gets the contents of STDIN
731
+ *
732
+ * @return string The current contents
733
+ */
682
734
public function getStdin ()
683
735
{
684
736
return $ this ->stdin ;
685
737
}
686
738
739
+ /**
740
+ * Sets the contents of STDIN
741
+ *
742
+ * @param string $stdin The new contents
743
+ */
687
744
public function setStdin ($ stdin )
688
745
{
689
746
$ this ->stdin = $ stdin ;
690
747
}
691
748
749
+ /**
750
+ * Gets the options for proc_open
751
+ *
752
+ * @return array The current options
753
+ */
692
754
public function getOptions ()
693
755
{
694
756
return $ this ->options ;
695
757
}
696
758
759
+ /**
760
+ * Sets the options for proc_open
761
+ *
762
+ * @param array $options The new options
763
+ */
697
764
public function setOptions (array $ options )
698
765
{
699
766
$ this ->options = $ options ;
700
767
}
701
768
769
+ /**
770
+ * Gets whether or not Windows compatibility is enabled
771
+ *
772
+ * This is true by default.
773
+ *
774
+ * @return Boolean
775
+ */
702
776
public function getEnhanceWindowsCompatibility ()
703
777
{
704
778
return $ this ->enhanceWindowsCompatibility ;
705
779
}
706
780
781
+ /**
782
+ * Sets whether or not Windows compatibility is enabled
783
+ *
784
+ * @param Boolean $enhance
785
+ */
707
786
public function setEnhanceWindowsCompatibility ($ enhance )
708
787
{
709
788
$ this ->enhanceWindowsCompatibility = (Boolean ) $ enhance ;
0 commit comments