-
-
Notifications
You must be signed in to change notification settings - Fork 143
Expand file tree
/
Copy pathBaseHTTPQRCodeProvider.php
More file actions
29 lines (23 loc) · 735 Bytes
/
BaseHTTPQRCodeProvider.php
File metadata and controls
29 lines (23 loc) · 735 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
declare(strict_types=1);
namespace RobThree\Auth\Providers\Qr;
abstract class BaseHTTPQRCodeProvider implements IQRCodeProvider
{
protected bool $verifyssl;
protected function getContent(string $url): string|bool
{
$curlhandle = curl_init();
curl_setopt_array($curlhandle, [
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CONNECTTIMEOUT => 10,
CURLOPT_DNS_CACHE_TIMEOUT => 10,
CURLOPT_TIMEOUT => 10,
CURLOPT_SSL_VERIFYPEER => $this->verifyssl,
CURLOPT_USERAGENT => 'TwoFactorAuth',
]);
$data = curl_exec($curlhandle);
curl_close($curlhandle);
return $data;
}
}