10000 merged branch boombatower/process-status-5453 (PR #5455) · glsee/symfony@41cb44b · GitHub
[go: up one dir, main page]

Skip to content

Commit 41cb44b

Browse files
committed
merged branch boombatower/process-status-5453 (PR symfony#5455)
This PR was squashed before being merged into the master branch (closes symfony#5455). Commits ------- 7ea2f76 [process] expose the process status. Discussion ---------- [process] expose the process status. Pull request for issue symfony#5453. --------------------------------------------------------------------------- by pborreli at 2012-09-07T07:30:01Z :+1: --------------------------------------------------------------------------- by drak at 2012-09-21T18:53:14Z This PR is missing the patch header in the description https://github.com/symfony/symfony-docs/blob/master/contributing/code/patches.rst#make-a-pull-request --------------------------------------------------------------------------- by stof at 2012-10-13T21:25:04Z @boombatower can you update the PR according to my comments and add some tests ?
2 parents d4c011d + 7ea2f76 commit 41cb44b

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

src/Symfony/Component/Process/Process.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -927,6 +927,30 @@ public function setEnhanceSigchildCompatibility($enhance)
927927
return $this;
928928
}
929929

930+
public function getStatus()
931+
{
932+
$this->updateStatus();
933+
934+
return $this->status;
935+
}
936+
937+
/**
938+
* Checks if the process has been started with no regard to current state.
939+
*
940+
* @return Boolean true if status is started or terminated, false otherwise
941+
*/
942+
public function isStarted()
943+
{
944+
return $this->status != self::STATUS_READY;
945+
}
946+
947+
public function isTerminated()
948+
{
949+
$this->updateStatus();
950+
951+
return $this->status == self::STATUS_TERMINATED;
952+
}
953+
930954
/**
931955
* Builds up the callback used by wait().
932956
*

0 commit comments

Comments
 (0)
0