Changeset 14 for Common/Process.php
- Timestamp:
- Aug 3, 2021, 11:36:12 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Common/Process.php
r13 r14 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 22 if (!$this->IsRunning()) … … 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 49 return is_resource($this->Handle);
Note:
See TracChangeset
for help on using the changeset viewer.