Conditions | 3 |
Paths | 3 |
Total Lines | 25 |
Code Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
40 | public function initScanner(){ |
||
41 | parent::initScanner(); |
||
42 | $this->writeHandle = @stream_socket_client( |
||
43 | 'unix://' . $this->socket, $errorCode, $errorMessage, 5 |
||
44 | ); |
||
45 | if (!$this->getWriteHandle()) { |
||
46 | throw new InitException( |
||
47 | sprintf( |
||
48 | 'Could not connect to socket "%s": %s (code %d)', |
||
49 | $this->socket, |
||
50 | $errorMessage, |
||
51 | $errorCode |
||
52 | ) |
||
53 | ); |
||
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 |