| Conditions | 3 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | 6 | public function exists($url, $curl = true) |
|
| 20 | { |
||
| 21 | 6 | if (!filter_var($url, FILTER_VALIDATE_URL)) |
|
| 22 | 6 | { |
|
| 23 | 2 | return false; |
|
| 24 | } |
||
| 25 | |||
| 26 | 4 | $status = array(); |
|
| 27 | 4 | $headers = $this->get_headers($url, $curl); |
|
| 28 | |||
| 29 | 4 | preg_match('/HTTP\/.* ([0-9]+) .*/', $headers , $status); |
|
| 30 | |||
| 31 | 4 | return ($status[1] == 200) ? true : false; |
|
| 32 | } |
||
| 78 |