| Conditions | 2 |
| Paths | 2 |
| Total Lines | 20 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | public function initScanner(){ |
||
| 19 | parent::initScanner(); |
||
| 20 | |||
| 21 | $this->writeHandle = stream_socket_client( |
||
| 22 | 'unix://' . $this->appConfig->getAvSocket(), $errorCode, $errorMessage, 5 |
||
| 23 | ); |
||
| 24 | if (!$this->getWriteHandle()) { |
||
| 25 | throw new InitException( |
||
| 26 | sprintf( |
||
| 27 | 'Could not connect to socket "%s": %s (code %d)', |
||
| 28 | $this->appConfig->getAvSocket(), |
||
| 29 | $errorMessage, |
||
| 30 | $errorCode |
||
| 31 | ) |
||
| 32 | ); |
||
| 33 | } |
||
| 34 | |||
| 35 | // request scan from the daemon |
||
| 36 | @fwrite($this->getWriteHandle(), "nINSTREAM\n"); |
||
|
|
|||
| 37 | } |
||
| 38 | } |
||
| 39 |
If you suppress an error, we recommend checking for the error condition explicitly: