| Conditions | 2 |
| Paths | 2 |
| Total Lines | 18 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 51 | public function getIterator() |
||
| 52 | { |
||
| 53 | $errno = null; |
||
| 54 | $errstr = null; |
||
| 55 | $handle = fsockopen($this->server, $this->port, $errno, $errstr, 30); |
||
| 56 | if (!$handle) { |
||
| 57 | throw new DatasetException("Socket error: $errstr ($errno)"); |
||
| 58 | } |
||
| 59 | |||
| 60 | $out = "GET " . $this->path . " HTTP/1.1\r\n"; |
||
| 61 | $out .= "Host: " . $this->server . "\r\n"; |
||
| 62 | $out .= "Connection: Close\r\n\r\n"; |
||
| 63 | |||
| 64 | fwrite($handle, $out); |
||
| 65 | |||
| 66 | $iterator = new SocketIterator($handle, $this->fields, $this->rowsep, $this->colsep); |
||
| 67 | return $iterator; |
||
| 68 | } |
||
| 69 | } |
||
| 70 |