Conditions | 4 |
Paths | 4 |
Total Lines | 19 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
54 | private function parse($headers) |
||
55 | { |
||
56 | foreach (preg_split('/\r\n|\r|\n/', $headers) as $i => $line) { |
||
57 | if ($i === 0) { |
||
58 | $this->headers['http_code'] = $line; |
||
59 | } else { |
||
60 | list($key, $value) = explode(': ', $line); |
||
61 | |||
62 | if ($key === 'Set-Cookie') { |
||
63 | list($textCookie) = explode(';', $value); |
||
64 | list($cookieKey, $cookieValue) = explode('=', $textCookie); |
||
65 | |||
66 | $this->cookies[$cookieKey] = $cookieValue; |
||
67 | } else { |
||
68 | $this->headers[$key] = $value; |
||
69 | } |
||
70 | } |
||
71 | } |
||
72 | } |
||
73 | } |
||
74 |