Changeset 95 for trunk/Packages/Common/Process.php
- Timestamp:
- Dec 6, 2021, 11:33:48 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/Common/Process.php
r93 r95 3 3 class Process 4 4 { 5 var$Command;6 var$Handle;7 var$Pipes;8 var$Environment;9 var$WorkingDir;10 5 public string $Command; 6 public $Handle; 7 public array $Pipes; 8 public array $Environment; 9 public ?string $WorkingDir; 10 11 11 function __construct() 12 12 { … … 17 17 $this->WorkingDir = null; 18 18 } 19 20 function Start() 19 20 function Start(): void 21 21 { 22 if (!$this->IsRunning())22 if (!$this->IsRunning()) 23 23 { 24 24 $DescriptorSpec = array( … … 28 28 ); 29 29 30 $this->Handle = proc_open($this->Command, $DescriptorSpec, $this->Pipes, 30 $this->Handle = proc_open($this->Command, $DescriptorSpec, $this->Pipes, 31 31 $this->WorkingDir, $this->Environment); 32 32 stream_set_blocking($this->Pipes[0], FALSE); … … 35 35 } 36 36 } 37 38 function Stop() 37 38 function Stop(): void 39 39 { 40 if ($this->IsRunning())40 if ($this->IsRunning()) 41 41 { 42 42 proc_close($this->Handle); … … 44 44 } 45 45 } 46 47 function IsRunning() 46 47 function IsRunning(): bool 48 48 { 49 return (is_resource($this->Handle));49 return is_resource($this->Handle); 50 50 } 51 51 }
Note:
See TracChangeset
for help on using the changeset viewer.