| Conditions | 3 |
| Paths | 3 |
| Total Lines | 25 |
| Code Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 29 | public function initScanner(){ |
||
| 30 | parent::initScanner(); |
||
| 31 | $this->writeHandle = stream_socket_client( |
||
| 32 | 'unix://' . $this->socket, $errorCode, $errorMessage, 5 |
||
| 33 | ); |
||
| 34 | if (!$this->getWriteHandle()) { |
||
| 35 | throw new InitException( |
||
| 36 | sprintf( |
||
| 37 | 'Could not connect to socket "%s": %s (code %d)', |
||
| 38 | $this->socket, |
||
| 39 | $errorMessage, |
||
| 40 | $errorCode |
||
| 41 | ) |
||
| 42 | ); |
||
| 43 | } |
||
| 44 | |||
| 45 | if (@fwrite($this->getWriteHandle(), "nINSTREAM\n") === false) { |
||
| 46 | throw new InitException( |
||
| 47 | sprintf( |
||
| 48 | 'Writing to socket "%s" failed', |
||
| 49 | $this->socket |
||
| 50 | ) |
||
| 51 | ); |
||
| 52 | } |
||
| 53 | } |
||
| 54 | } |
||
| 55 |