| 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 | 9 | public static function configSecure(): StreamConfig |
|
| 27 | |||
| 28 | 5 | public static function configInsecure(): StreamConfig |
|
| 44 | |||
| 45 | public static function configCrl(): StreamConfig |
||
| 46 | { |
||
| 47 | $streamContext = stream_context_create( |
||
| 48 | [ |
||
| 49 | 'http' => [ |
||
| 50 | 'method' => 'GET', |
||
| 51 | 'max_redirects' => '0', |
||
| 52 | 'ignore_errors' => '1', |
||
| 53 | ], |
||
| 54 | ] |
||
| 55 | ); |
||
| 56 | |||
| 57 | return new static($streamContext); |
||
| 58 | } |
||
| 59 | |||
| 60 | 9 | public function __construct($streamContext) |
|
| 64 | |||
| 65 | 8 | public function getContext() |
|
| 69 | } |
||
| 70 |