1 | <?php |
||
5 | class StreamConfig |
||
6 | { |
||
7 | /** |
||
8 | * The stream settings for the client. |
||
9 | * |
||
10 | * @return A stream context resource. |
||
11 | */ |
||
12 | protected $streamContext; |
||
13 | |||
14 | 6 | public static function configSecure(): self |
|
28 | |||
29 | 1 | public static function configInsecure(): self |
|
46 | |||
47 | public static function configCrl(): self |
||
48 | { |
||
49 | $streamContext = stream_context_create( |
||
50 | [ |
||
51 | 'http' => [ |
||
52 | 'method' => 'GET', |
||
53 | 'max_redirects' => '0', |
||
54 | 'ignore_errors' => '1', |
||
55 | ], |
||
56 | ] |
||
57 | ); |
||
58 | |||
59 | return new static($streamContext); |
||
60 | } |
||
61 | |||
62 | 6 | public function __construct($streamContext) |
|
66 | |||
67 | 1 | public function getContext() |
|
71 | } |
||
72 |