| Conditions | 2 |
| Paths | 2 |
| Total Lines | 10 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 29 | private function pingHandler(string $url): bool { |
||
| 30 | |||
| 31 | $ch = curl_init($url); |
||
| 32 | curl_setopt($ch, CURLOPT_TIMEOUT, 5); |
||
|
|
|||
| 33 | curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5); |
||
| 34 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
||
| 35 | $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE); |
||
| 36 | curl_close($ch); |
||
| 37 | |||
| 38 | return $httpcode >= 200 && $httpcode < 300; |
||
| 39 | } |
||
| 40 | } |