| Conditions | 3 |
| Paths | 3 |
| Total Lines | 19 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 59 | public function read() |
||
| 60 | { |
||
| 61 | $response = ''; |
||
| 62 | while (true) { |
||
| 63 | $line = fgets($this->stream); |
||
| 64 | $response .= $line; |
||
| 65 | |||
| 66 | // To distinguish the end of an FTP reply, the RFC959 indicates that the last line of |
||
| 67 | // a the reply must be on a special format, it must be begin with 3 digits followed |
||
| 68 | // by a space. |
||
| 69 | //@link https://tools.ietf.org/html/rfc959#section-4 |
||
| 70 | if (preg_match('/^\d{3}+ /', $line) !== 0) { |
||
| 71 | break; |
||
| 72 | } |
||
| 73 | } |
||
| 74 | |||
| 75 | $this->log($response); |
||
| 76 | |||
| 77 | return $response; |
||
| 78 | } |
||
| 92 | } |