| Conditions | 1 |
| Paths | 1 |
| Total Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | public function init() |
||
| 16 | { |
||
| 17 | $this->header('Content-Type: text/plain'); |
||
| 18 | |||
| 19 | $this->proc = new \PHPDaemon\Core\ShellCommand(); |
||
| 20 | $this->proc->onReadData(function ($stream, $data) { |
||
|
|
|||
| 21 | echo $data; |
||
| 22 | }); |
||
| 23 | $this->proc->onEOF(function ($stream) { |
||
| 24 | $this->wakeup(); |
||
| 25 | }); |
||
| 26 | $this->proc->nice(256); |
||
| 27 | $this->proc->execute('/bin/ls -l /tmp'); |
||
| 28 | } |
||
| 29 | |||
| 53 |
If you implement
__calland you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.This is often the case, when
__callis implemented by a parent class and only the child class knows which methods exist: