Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame^] | 1 | <?php |
| 2 | |
| 3 | namespace RobThree\Auth\Providers\Qr; |
| 4 | |
| 5 | abstract class BaseHTTPQRCodeProvider implements IQRCodeProvider |
| 6 | { |
| 7 | protected $verifyssl; |
| 8 | |
| 9 | protected function getContent($url) |
| 10 | { |
| 11 | $curlhandle = curl_init(); |
| 12 | |
| 13 | curl_setopt_array($curlhandle, array( |
| 14 | CURLOPT_URL => $url, |
| 15 | CURLOPT_RETURNTRANSFER => true, |
| 16 | CURLOPT_CONNECTTIMEOUT => 10, |
| 17 | CURLOPT_DNS_CACHE_TIMEOUT => 10, |
| 18 | CURLOPT_TIMEOUT => 10, |
| 19 | CURLOPT_SSL_VERIFYPEER => $this->verifyssl, |
| 20 | CURLOPT_USERAGENT => 'TwoFactorAuth' |
| 21 | )); |
| 22 | $data = curl_exec($curlhandle); |
| 23 | |
| 24 | curl_close($curlhandle); |
| 25 | return $data; |
| 26 | } |
| 27 | } |