Use PHP's new class constant mechanism.

Let gen_stub.php define the constants for us, including deriving their
actual values from C defines.

As a side-effect we have to drop support for PHP < 7.2 as it does not
have interned strings.
This commit is contained in:
michael-grunder
2022-11-22 15:03:51 -08:00
committed by Michael Grunder
parent b580505b40
commit 2a6dee5d4d
8 changed files with 1176 additions and 108 deletions

View File

@@ -7,6 +7,45 @@
*/
class RedisCluster {
/**
*
* @var int
* @cvalue REDIS_OPT_FAILOVER
*
*/
public const OPT_SLAVE_FAILOVER = UNKNOWN;
/**
*
* @var int
* @cvalue REDIS_FAILOVER_NONE
*
*/
public const FAILOVER_NONE = UNKNOWN;
/**
*
* @var int
* @cvalue REDIS_FAILOVER_ERROR
*
*/
public const FAILOVER_ERROR = UNKNOWN;
/**
*
* @var int
* @cvalue REDIS_FAILOVER_DISTRIBUTE
*
*/
public const FAILOVER_DISTRIBUTE = UNKNOWN;
/**
*
* @var int
* @cvalue REDIS_FAILOVER_DISTRIBUTE_SLAVES
*
*/
public const FAILOVER_DISTRIBUTE_SLAVES = UNKNOWN;
public function __construct(string|null $name, array $seeds = NULL, int|float $timeout = 0, int|float $read_timeout = 0, bool $persistent = false, #[\SensitiveParameter] mixed $auth = NULL, array $context = NULL);