| Conditions | 3 |
| Paths | 3 |
| Total Lines | 25 |
| Code Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 13 |
| CRAP Score | 3.4977 |
| Changes | 0 | ||
| 1 | <?php |
||
| 40 | 1 | public function initScanner(){ |
|
| 41 | 1 | parent::initScanner(); |
|
| 42 | 1 | $this->writeHandle = @stream_socket_client( |
|
| 43 | 1 | 'unix://' . $this->socket, $errorCode, $errorMessage, 5 |
|
| 44 | 1 | ); |
|
| 45 | 1 | if (!$this->getWriteHandle()) { |
|
| 46 | 1 | throw new InitException( |
|
| 47 | 1 | sprintf( |
|
| 48 | 1 | 'Could not connect to socket "%s": %s (code %d)', |
|
| 49 | 1 | $this->socket, |
|
| 50 | 1 | $errorMessage, |
|
| 51 | $errorCode |
||
| 52 | 1 | ) |
|
| 53 | 1 | ); |
|
| 54 | } |
||
| 55 | |||
| 56 | if (@fwrite($this->getWriteHandle(), "nINSTREAM\n") === false) { |
||
| 57 | throw new InitException( |
||
| 58 | sprintf( |
||
| 59 | 'Writing to socket "%s" failed', |
||
| 60 | $this->socket |
||
| 61 | ) |
||
| 62 | ); |
||
| 63 | } |
||
| 64 | } |
||
| 65 | } |
||
| 66 |