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