You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// last exit code is output on the fourth pipe and caught to work around --enable-sigchild
302
295
$descriptors[3] = array('pipe', 'w');
303
296
@@ -665,15 +658,9 @@ public function clearErrorOutput()
665
658
* Returns the exit code returned by the process.
666
659
*
667
660
* @return null|int The exit status code, null if the Process is not terminated
668
-
*
669
-
* @throws RuntimeException In case --enable-sigchild is activated and the sigchild compatibility mode is disabled
670
661
*/
671
662
publicfunctiongetExitCode()
672
663
{
673
-
if (!$this->enhanceSigchildCompatibility && $this->isSigchildEnabled()) {
674
-
thrownewRuntimeException('This PHP has been compiled with --enable-sigchild. You must use setEnhanceSigchildCompatibility() to use this method.');
675
-
}
676
-
677
664
$this->updateStatus(false);
678
665
679
666
return$this->exitcode;
@@ -716,17 +703,12 @@ public function isSuccessful()
716
703
*
717
704
* @return bool
718
705
*
719
-
* @throws RuntimeException In case --enable-sigchild is activated
720
-
* @throws LogicException In case the process is not terminated
706
+
* @throws LogicException In case the process is not terminated
721
707
*/
722
708
publicfunctionhasBeenSignaled()
723
709
{
724
710
$this->requireProcessIsTerminated(__FUNCTION__);
725
711
726
-
if (!$this->enhanceSigchildCompatibility && $this->isSigchildEnabled()) {
727
-
thrownewRuntimeException('This PHP has been compiled with --enable-sigchild. Term signal can not be retrieved.');
728
-
}
729
-
730
712
return$this->processInformation['signaled'];
731
713
}
732
714
@@ -744,7 +726,7 @@ public function getTermSignal()
744
726
{
745
727
$this->requireProcessIsTerminated(__FUNCTION__);
746
728
747
-
if ($this->isSigchildEnabled() && (!$this->enhanceSigchildCompatibility || -1 === $this->processInformation['termsig'])) {
729
+
if ($this->isSigchildEnabled() && -1 === $this->processInformation['termsig']) {
748
730
thrownewRuntimeException('This PHP has been compiled with --enable-sigchild. Term signal can not be retrieved.');
749
731
}
750
732
@@ -1153,42 +1135,6 @@ public function setInput($input)
1153
1135
return$this;
1154
1136
}
1155
1137
1156
-
/**
1157
-
* Returns whether sigchild compatibility mode is activated or not.
1158
-
*
1159
-
* @return bool
1160
-
*
1161
-
* @deprecated since version 3.3, to be removed in 4.0. Sigchild compatibility will always be enabled.
1162
-
*/
1163
-
publicfunctiongetEnhanceSigchildCompatibility()
1164
-
{
1165
-
@trigger_error(sprintf('The %s() method is deprecated since version 3.3 and will be removed in 4.0. Sigchild compatibility will always be enabled.', __METHOD__), E_USER_DEPRECATED);
1166
-
1167
-
return$this->enhanceSigchildCompatibility;
1168
-
}
1169
-
1170
-
/**
1171
-
* Activates sigchild compatibility mode.
1172
-
*
1173
-
* Sigchild compatibility mode is required to get the exit code and
1174
-
* determine the success of a process when PHP has been compiled with
1175
-
* the --enable-sigchild option
1176
-
*
1177
-
* @param bool $enhance
1178
-
*
1179
-
* @return self The current Process instance
1180
-
*
1181
-
* @deprecated since version 3.3, to be removed in 4.0.
@trigger_error(sprintf('The %s() method is deprecated since version 3.3 and will be removed in 4.0. Sigchild compatibility will always be enabled.', __METHOD__), E_USER_DEPRECATED);
if (false !== $enhance = getenv('ENHANCE_SIGCHLD')) {
1491
-
try {
1492
-
$process->setEnhanceSigchildCompatibility(false);
1493
-
$process->getExitCode();
1494
-
$this->fail('ENHANCE_SIGCHLD must be used together with a sigchild-enabled PHP.');
1495
-
} catch (RuntimeException$e) {
1496
-
$this->assertSame('This PHP has been compiled with --enable-sigchild. You must use setEnhanceSigchildCompatibility() to use this method.', $e->getMessage());
0 commit comments