| 1 |
<?php |
| 2 |
namespace Aws\Retry\V3; |
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
final class OptIn |
| 12 |
{ |
| 13 |
public const ENV = 'AWS_NEW_RETRIES_2026'; |
| 14 |
|
| 15 |
private static ?bool $enabled = null; |
| 16 |
|
| 17 |
public static function isEnabled(): bool |
| 18 |
{ |
| 19 |
if (self::$enabled === null) { |
| 20 |
$value = getenv(self::ENV); |
| 21 |
if (is_string($value) && trim($value) === 'true') { |
| 22 |
self::$enabled = true; |
| 23 |
} else { |
| 24 |
self::$enabled = false; |
| 25 |
} |
| 26 |
} |
| 27 |
|
| 28 |
return self::$enabled; |
| 29 |
} |
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
public static function reset(): void |
| 37 |
{ |
| 38 |
self::$enabled = null; |
| 39 |
} |
| 40 |
} |