[N] Illuminate\Redis\
[C] RedisManager
| type | summary |
|---|---|
| Factory | |
[p] $app The application instance.
The application instance.
protected Illuminate\Contracts\Foundation\Application $app = null
[p] $driver The name of the default driver.
The name of the default driver.
protected string $driver = null
[p] $customCreators The registered custom driver creators.
The registered custom driver creators.
protected array $customCreators = []
[p] $config The Redis server configurations.
The Redis server configurations.
protected array $config = null
[p] $connections The Redis connections.
The Redis connections.
protected mixed $connections = null
[p] $events Indicates whether event dispatcher is set on connections.
Indicates whether event dispatcher is set on connections.
protected bool $events = false
[m] __construct Create a new Redis manager instance.
Create a new Redis manager instance.
public function __construct( Illuminate\Contracts\Foundation\Application $app, string $driver, array $config ): void
| type | name | summary |
|---|---|---|
| Application | $app |
|
| string | $driver |
|
| array | $config |
|
| type | summary |
|---|---|
| void | |
[m] connection Get a Redis connection by name.
Get a Redis connection by name.
public function connection(string|null $name = null): Illuminate\Redis\Connections\Connection
| type | name | summary |
|---|---|---|
| string|null | $name = null |
|
| type | summary |
|---|---|
| Connection | |
| kind | source | summary |
|---|---|---|
| implement | Factory::connection() | |
[m] resolve Resolve the given connection by name.
Resolve the given connection by name.
public function resolve(string|null $name = null): Illuminate\Redis\Connections\Connection
| type | name | summary |
|---|---|---|
| string|null | $name = null |
|
| type | summary |
|---|---|
| Connection | |
| type | summary |
|---|---|
| InvalidArgumentException | |
[m] resolveCluster Resolve the given cluster connection by name.
Resolve the given cluster connection by name.
protected function resolveCluster(string $name): Illuminate\Redis\Connections\Connection
| type | name | summary |
|---|---|---|
| string | $name |
|
| type | summary |
|---|---|
| Connection | |
[m] configure Configure the given connection to prepare it for commands.
Configure the given connection to prepare it for commands.
protected function configure( Illuminate\Redis\Connections\Connection $connection, string $name ): Illuminate\Redis\Connections\Connection
| type | name | summary |
|---|---|---|
| Connection | $connection |
|
| string | $name |
|
| type | summary |
|---|---|
| Connection | |
[m] connector Get the connector instance for the current driver.
Get the connector instance for the current driver.
protected function connector(): Illuminate\Contracts\Redis\Connector
| type | summary |
|---|---|
| Connector | |
[m] parseConnectionConfiguration Parse the Redis connection configuration.
Parse the Redis connection configuration.
protected function parseConnectionConfiguration(mixed $config): array
| type | name | summary |
|---|---|---|
| mixed | $config |
|
| type | summary |
|---|---|
| array | |
[m] connections Return all of the created connections.
Return all of the created connections.
public function connections(): array
| type | summary |
|---|---|
| array | |
[m] enableEvents Enable the firing of Redis command events.
Enable the firing of Redis command events.
public function enableEvents(): void
| type | summary |
|---|---|
| void | |
[m] disableEvents Disable the firing of Redis command events.
Disable the firing of Redis command events.
public function disableEvents(): void
| type | summary |
|---|---|
| void | |
[m] setDriver Set the default driver.
Set the default driver.
public function setDriver(string $driver): void
| type | name | summary |
|---|---|---|
| string | $driver |
|
| type | summary |
|---|---|
| void | |
[m] purge Disconnect the given connection and remove from local cache.
Disconnect the given connection and remove from local cache.
public function purge(string|null $name = null): void
| type | name | summary |
|---|---|---|
| string|null | $name = null |
|
| type | summary |
|---|---|
| void | |
[m] extend Register a custom driver creator Closure.
Register a custom driver creator Closure.
public function extend( string $driver, \Closure $callback ): Illuminate\Redis\RedisManager
| type | name | summary |
|---|---|---|
| string | $driver |
|
| Closure | $callback |
|
| type | summary |
|---|---|
| RedisManager | |
[m] __call Pass methods onto the default Redis connection.
Pass methods onto the default Redis connection.
public function __call( string $method, array $parameters ): mixed
| type | name | summary |
|---|---|---|
| string | $method |
|
| array | $parameters |
|
| type | summary |
|---|---|
| mixed | |
[C] RedisServiceProvider
Hierarchy
| type | summary |
|---|---|
| ServiceProvider | |
| type | summary |
|---|---|
| DeferrableProvider | |
[p] $app The application instance.
The application instance.
protected Illuminate\Contracts\Foundation\Application $app = null
| kind | source | summary |
|---|---|---|
| inherit | ServiceProvider::$app | |
[p] $bootingCallbacks All of the registered booting callbacks.
All of the registered booting callbacks.
protected array $bootingCallbacks = []
| kind | source | summary |
|---|---|---|
| inherit | ServiceProvider::$bootingCallbacks | |
[p] $bootedCallbacks All of the registered booted callbacks.
All of the registered booted callbacks.
protected array $bootedCallbacks = []
| kind | source | summary |
|---|---|---|
| inherit | ServiceProvider::$bootedCallbacks | |
[P] $publishes The paths that should be published.
The paths that should be published.
public static array $publishes = []
| kind | source | summary |
|---|---|---|
| inherit | ServiceProvider::$publishes | |
[P] $publishGroups The paths that should be published by group.
The paths that should be published by group.
public static array $publishGroups = []
| kind | source | summary |
|---|---|---|
| inherit | ServiceProvider::$publishGroups | |
[m] register Register the service provider.
Register the service provider.
public function register(): void
| type | summary |
|---|---|
| void | |
| kind | source | summary |
|---|---|---|
| override | ServiceProvider::register() | |
[m] provides Get the services provided by the provider.
Get the services provided by the provider.
public function provides(): array
| type | summary |
|---|---|
| array | |
| kind | source | summary |
|---|---|---|
| implement | DeferrableProvider::provides() | |
[m] __construct Create a new service provider instance.
Create a new service provider instance.
public function __construct(Illuminate\Contracts\Foundation\Application $app): void
| type | name | summary |
|---|---|---|
| Application | $app |
|
| type | summary |
|---|---|
| void | |
| kind | source | summary |
|---|---|---|
| inherit | ServiceProvider::__construct() | |
[m] booting Register a booting callback to be run before the "boot" method is called.
Register a booting callback to be run before the "boot" method is called.
public function booting(\Closure $callback): void
| type | name | summary |
|---|---|---|
| Closure | $callback |
|
| type | summary |
|---|---|
| void | |
| kind | source | summary |
|---|---|---|
| inherit | ServiceProvider::booting() | |
[m] booted Register a booted callback to be run after the "boot" method is called.
Register a booted callback to be run after the "boot" method is called.
public function booted(\Closure $callback): void
| type | name | summary |
|---|---|---|
| Closure | $callback |
|
| type | summary |
|---|---|
| void | |
| kind | source | summary |
|---|---|---|
| inherit | ServiceProvider::booted() | |
[m] callBootingCallbacks Call the registered booting callbacks.
Call the registered booting callbacks.
public function callBootingCallbacks(): void
| type | summary |
|---|---|
| void | |
| kind | source | summary |
|---|---|---|
| inherit | ServiceProvider::callBootingCallbacks() | |
[m] callBootedCallbacks Call the registered booted callbacks.
Call the registered booted callbacks.
public function callBootedCallbacks(): void
| type | summary |
|---|---|
| void | |
| kind | source | summary |
|---|---|---|
| inherit | ServiceProvider::callBootedCallbacks() | |
[m] mergeConfigFrom Merge the given configuration with the existing configuration.
Merge the given configuration with the existing configuration.
protected function mergeConfigFrom( string $path, string $key ): void
| type | name | summary |
|---|---|---|
| string | $path |
|
| string | $key |
|
| type | summary |
|---|---|
| void | |
| kind | source | summary |
|---|---|---|
| inherit | ServiceProvider::mergeConfigFrom() | |
[m] loadRoutesFrom Load the given routes file if routes are not already cached.
Load the given routes file if routes are not already cached.
protected function loadRoutesFrom(string $path): void
| type | name | summary |
|---|---|---|
| string | $path |
|
| type | summary |
|---|---|
| void | |
| kind | source | summary |
|---|---|---|
| inherit | ServiceProvider::loadRoutesFrom() | |
[m] loadViewsFrom Register a view file namespace.
Register a view file namespace.
protected function loadViewsFrom( string|array $path, string $namespace ): void
| type | name | summary |
|---|---|---|
| string|array | $path |
|
| string | $namespace |
|
| type | summary |
|---|---|
| void | |
| kind | source | summary |
|---|---|---|
| inherit | ServiceProvider::loadViewsFrom() | |
[m] loadViewComponentsAs Register the given view components with a custom prefix.
Register the given view components with a custom prefix.
protected function loadViewComponentsAs( string $prefix, array $components ): void
| type | name | summary |
|---|---|---|
| string | $prefix |
|
| array | $components |
|
| type | summary |
|---|---|
| void | |
| kind | source | summary |
|---|---|---|
| inherit | ServiceProvider::loadViewComponentsAs() | |
[m] loadTranslationsFrom Register a translation file namespace.
Register a translation file namespace.
protected function loadTranslationsFrom( string $path, string $namespace ): void
| type | name | summary |
|---|---|---|
| string | $path |
|
| string | $namespace |
|
| type | summary |
|---|---|
| void | |
| kind | source | summary |
|---|---|---|
| inherit | ServiceProvider::loadTranslationsFrom() | |
[m] loadJsonTranslationsFrom Register a JSON translation file path.
Register a JSON translation file path.
protected function loadJsonTranslationsFrom(string $path): void
| type | name | summary |
|---|---|---|
| string | $path |
|
| type | summary |
|---|---|
| void | |
| kind | source | summary |
|---|---|---|
| inherit | ServiceProvider::loadJsonTranslationsFrom() | |
[m] loadMigrationsFrom Register database migration paths.
Register database migration paths.
protected function loadMigrationsFrom(array|string $paths): void
| type | name | summary |
|---|---|---|
| array|string | $paths |
|
| type | summary |
|---|---|
| void | |
| kind | source | summary |
|---|---|---|
| inherit | ServiceProvider::loadMigrationsFrom() | |
[m] loadFactoriesFrom Register Eloquent model factory paths.
Register Eloquent model factory paths.
protected function loadFactoriesFrom(array|string $paths): void
| type | name | summary |
|---|---|---|
| array|string | $paths |
|
| type | summary |
|---|---|
| void | |
| kind | source | summary |
|---|---|---|
| inherit | ServiceProvider::loadFactoriesFrom() | |
[m] callAfterResolving Setup an after resolving listener, or fire immediately if already resolved.
Setup an after resolving listener, or fire immediately if already resolved.
protected function callAfterResolving( string $name, callable $callback ): void
| type | name | summary |
|---|---|---|
| string | $name |
|
| callable | $callback |
|
| type | summary |
|---|---|
| void | |
| kind | source | summary |
|---|---|---|
| inherit | ServiceProvider::callAfterResolving() | |
[m] publishes Register paths to be published by the publish command.
Register paths to be published by the publish command.
protected function publishes( array $paths, mixed $groups = null ): void
| type | name | summary |
|---|---|---|
| array | $paths |
|
| mixed | $groups = null |
|
| type | summary |
|---|---|
| void | |
| kind | source | summary |
|---|---|---|
| inherit | ServiceProvider::publishes() | |
[m] ensurePublishArrayInitialized Ensure the publish array for the service provider is initialized.
Ensure the publish array for the service provider is initialized.
protected function ensurePublishArrayInitialized(string $class): void
| type | name | summary |
|---|---|---|
| string | $class |
|
| type | summary |
|---|---|
| void | |
| kind | source | summary |
|---|---|---|
| inherit | ServiceProvider::ensurePublishArrayInitialized() | |
[m] addPublishGroup Add a publish group / tag to the service provider.
Add a publish group / tag to the service provider.
protected function addPublishGroup( string $group, array $paths ): void
| type | name | summary |
|---|---|---|
| string | $group |
|
| array | $paths |
|
| type | summary |
|---|---|
| void | |
| kind | source | summary |
|---|---|---|
| inherit | ServiceProvider::addPublishGroup() | |
[M] pathsToPublish Get the paths to publish.
Get the paths to publish.
public static function pathsToPublish( string|null $provider = null, string|null $group = null ): array
| type | name | summary |
|---|---|---|
| string|null | $provider = null |
|
| string|null | $group = null |
|
| type | summary |
|---|---|
| array | |
| kind | source | summary |
|---|---|---|
| inherit | ServiceProvider::pathsToPublish() | |
[M] pathsForProviderOrGroup Get the paths for the provider or group (or both).
Get the paths for the provider or group (or both).
protected static function pathsForProviderOrGroup( string|null $provider, string|null $group ): array
| type | name | summary |
|---|---|---|
| string|null | $provider |
|
| string|null | $group |
|
| type | summary |
|---|---|
| array | |
| kind | source | summary |
|---|---|---|
| inherit | ServiceProvider::pathsForProviderOrGroup() | |
[M] pathsForProviderAndGroup Get the paths for the provider and group.
Get the paths for the provider and group.
protected static function pathsForProviderAndGroup( string $provider, string $group ): array
| type | name | summary |
|---|---|---|
| string | $provider |
|
| string | $group |
|
| type | summary |
|---|---|
| array | |
| kind | source | summary |
|---|---|---|
| inherit | ServiceProvider::pathsForProviderAndGroup() | |
[M] publishableProviders Get the service providers available for publishing.
Get the service providers available for publishing.
public static function publishableProviders(): array
| type | summary |
|---|---|
| array | |
| kind | source | summary |
|---|---|---|
| inherit | ServiceProvider::publishableProviders() | |
[M] publishableGroups Get the groups available for publishing.
Get the groups available for publishing.
public static function publishableGroups(): array
| type | summary |
|---|---|
| array | |
| kind | source | summary |
|---|---|---|
| inherit | ServiceProvider::publishableGroups() | |
[m] commands Register the package's custom Artisan commands.
Register the package's custom Artisan commands.
public function commands(array|mixed $commands): void
| type | name | summary |
|---|---|---|
| array|mixed | $commands |
|
| type | summary |
|---|---|
| void | |
| kind | source | summary |
|---|---|---|
| inherit | ServiceProvider::commands() | |
[m] when Get the events that trigger this service provider to register.
Get the events that trigger this service provider to register.
public function when(): array
| type | summary |
|---|---|
| array | |
| kind | source | summary |
|---|---|---|
| inherit | ServiceProvider::when() | |
[m] isDeferred Determine if the provider is deferred.
Determine if the provider is deferred.
public function isDeferred(): bool
| type | summary |
|---|---|
| bool | |
| kind | source | summary |
|---|---|---|
| inherit | ServiceProvider::isDeferred() | |
[N] Illuminate\Redis\Connections\
[C] Connection
Hierarchy
| type | summary |
|---|---|
| Macroable | |
[p] $client The Redis client.
The Redis client.
protected \Redis $client = null
[p] $name The Redis connection name.
The Redis connection name.
protected string|null $name = null
[p] $events The event dispatcher instance.
The event dispatcher instance.
protected Illuminate\Contracts\Events\Dispatcher $events = null
[P] $macros The registered string macros.
The registered string macros.
protected static array $macros = []
| kind | source | summary |
|---|---|---|
| instead | Macroable::$macros | |
[m] createSubscription Subscribe to a set of given channels for messages.
Subscribe to a set of given channels for messages.
abstract public function createSubscription( array|string $channels, \Closure $callback, string $method = "subscribe" ): void
| type | name | summary |
|---|---|---|
| array|string | $channels |
|
| Closure | $callback |
|
| string | $method = "subscribe" |
|
| type | summary |
|---|---|
| void | |
[m] funnel Funnel a callback for a maximum number of simultaneous executions.
Funnel a callback for a maximum number of simultaneous executions.
public function funnel(string $name): Illuminate\Redis\Limiters\ConcurrencyLimiterBuilder
| type | name | summary |
|---|---|---|
| string | $name |
|
| type | summary |
|---|---|
| ConcurrencyLimiterBuilder | |
[m] throttle Throttle a callback for a maximum number of executions over a given duration.
Throttle a callback for a maximum number of executions over a given duration.
public function throttle(string $name): Illuminate\Redis\Limiters\DurationLimiterBuilder
| type | name | summary |
|---|---|---|
| string | $name |
|
| type | summary |
|---|---|
| DurationLimiterBuilder | |
[m] client Get the underlying Redis client.
Get the underlying Redis client.
public function client(): mixed
| type | summary |
|---|---|
| mixed | |
[m] subscribe Subscribe to a set of given channels for messages.
Subscribe to a set of given channels for messages.
public function subscribe( array|string $channels, \Closure $callback ): void
| type | name | summary |
|---|---|---|
| array|string | $channels |
|
| Closure | $callback |
|
| type | summary |
|---|---|
| void | |
[m] psubscribe Subscribe to a set of given channels with wildcards.
Subscribe to a set of given channels with wildcards.
public function psubscribe( array|string $channels, \Closure $callback ): void
| type | name | summary |
|---|---|---|
| array|string | $channels |
|
| Closure | $callback |
|
| type | summary |
|---|---|
| void | |
[m] command Run a command against the Redis database.
Run a command against the Redis database.
public function command( string $method, array $parameters = [] ): mixed
| type | name | summary |
|---|---|---|
| string | $method |
|
| array | $parameters = [] |
|
| type | summary |
|---|---|
| mixed | |
[m] event Fire the given event if possible.
Fire the given event if possible.
protected function event(mixed $event): void
| type | name | summary |
|---|---|---|
| mixed | $event |
|
| type | summary |
|---|---|
| void | |
[m] listen Register a Redis command listener with the connection.
Register a Redis command listener with the connection.
public function listen(\Closure $callback): void
| type | name | summary |
|---|---|---|
| Closure | $callback |
|
| type | summary |
|---|---|
| void | |
[m] getName Get the connection name.
Get the connection name.
public function getName(): string|null
| type | summary |
|---|---|
| string|null | |
[m] setName Set the connections name.
Set the connections name.
public function setName(string $name): Illuminate\Redis\Connections\Connection
| type | name | summary |
|---|---|---|
| string | $name |
|
| type | summary |
|---|---|
| Connection | |
[m] getEventDispatcher Get the event dispatcher used by the connection.
Get the event dispatcher used by the connection.
public function getEventDispatcher(): Illuminate\Contracts\Events\Dispatcher
| type | summary |
|---|---|
| Dispatcher | |
[m] setEventDispatcher Set the event dispatcher instance on the connection.
Set the event dispatcher instance on the connection.
public function setEventDispatcher(Illuminate\Contracts\Events\Dispatcher $events): void
| type | name | summary |
|---|---|---|
| Dispatcher | $events |
|
| type | summary |
|---|---|
| void | |
[m] unsetEventDispatcher Unset the event dispatcher instance on the connection.
Unset the event dispatcher instance on the connection.
public function unsetEventDispatcher(): void
| type | summary |
|---|---|
| void | |
[m] __call Pass other method calls down to the underlying client.
Pass other method calls down to the underlying client.
public function __call( string $method, array $parameters ): mixed
| type | name | summary |
|---|---|---|
| string | $method |
|
| array | $parameters |
|
| type | summary |
|---|---|
| mixed | |
| kind | source | summary |
|---|---|---|
| override | Macroable::__call() | |
[M] macro Register a custom macro.
Register a custom macro.
public static function macro( string $name, object|callable $macro ): void
| type | name | summary |
|---|---|---|
| string | $name |
|
| object|callable | $macro |
|
| type | summary |
|---|---|
| void | |
| kind | source | summary |
|---|---|---|
| instead | Macroable::macro() | |
[M] mixin Mix another object into the class.
Mix another object into the class.
public static function mixin( object $mixin, bool $replace = true ): void
| type | name | summary |
|---|---|---|
| object | $mixin |
|
| bool | $replace = true |
|
| type | summary |
|---|---|
| void | |
| type | summary |
|---|---|
| ReflectionException | |
| kind | source | summary |
|---|---|---|
| instead | Macroable::mixin() | |
[M] hasMacro Checks if macro is registered.
Checks if macro is registered.
public static function hasMacro(string $name): bool
| type | name | summary |
|---|---|---|
| string | $name |
|
| type | summary |
|---|---|
| bool | |
| kind | source | summary |
|---|---|---|
| instead | Macroable::hasMacro() | |
[M] flushMacros Flush the existing macros.
Flush the existing macros.
public static function flushMacros(): void
| type | summary |
|---|---|
| void | |
| kind | source | summary |
|---|---|---|
| instead | Macroable::flushMacros() | |
[M] __callStatic Dynamically handle calls to the class.
Dynamically handle calls to the class.
public static function __callStatic( string $method, array $parameters ): mixed
| type | name | summary |
|---|---|---|
| string | $method |
|
| array | $parameters |
|
| type | summary |
|---|---|
| mixed | |
| type | summary |
|---|---|
| BadMethodCallException | |
| kind | source | summary |
|---|---|---|
| instead | Macroable::__callStatic() | |
[m] macroCall Dynamically handle calls to the class.
Dynamically handle calls to the class.
public function macroCall( string $method, array $parameters ): mixed
| type | name | summary |
|---|---|---|
| string | $method |
|
| array | $parameters |
|
| type | summary |
|---|---|
| mixed | |
| type | summary |
|---|---|
| BadMethodCallException | |
| kind | source | summary |
|---|---|---|
| instead | Macroable::__call() | |
[C] PhpRedisClusterConnection
Hierarchy
| type | summary |
|---|---|
| PhpRedisConnection | |
| Connection | |
| type | summary |
|---|---|
| Connection | |
[p] $connector The connection creation callback.
The connection creation callback.
protected callable $connector = null
| kind | source | summary |
|---|---|---|
| inherit | PhpRedisConnection::$connector | The connection creation callback. |
[p] $config The connection configuration array.
The connection configuration array.
protected array $config = null
| kind | source | summary |
|---|---|---|
| inherit | PhpRedisConnection::$config | The connection configuration array. |
[p] $client The Redis client.
The Redis client.
protected \Redis $client = null
| kind | source | summary |
|---|---|---|
| inherit | Connection::$client | The Redis client. |
[p] $name The Redis connection name.
The Redis connection name.
protected string|null $name = null
| kind | source | summary |
|---|---|---|
| inherit | Connection::$name | The Redis connection name. |
[p] $events The event dispatcher instance.
The event dispatcher instance.
protected Illuminate\Contracts\Events\Dispatcher $events = null
| kind | source | summary |
|---|---|---|
| inherit | Connection::$events | The event dispatcher instance. |
[P] $macros The registered string macros.
The registered string macros.
protected static array $macros = []
| kind | source | summary |
|---|---|---|
| inherit | Connection::$macros | The registered string macros. |
[p] $supportsPacking Indicates if Redis supports packing.
Indicates if Redis supports packing.
protected bool|null $supportsPacking = null
| kind | source | summary |
|---|---|---|
| inherit | PhpRedisConnection::$supportsPacking | Indicates if Redis supports packing. |
[p] $supportsLzf Indicates if Redis supports LZF compression.
Indicates if Redis supports LZF compression.
protected bool|null $supportsLzf = null
| kind | source | summary |
|---|---|---|
| inherit | PhpRedisConnection::$supportsLzf | Indicates if Redis supports LZF compression. |
[p] $supportsZstd Indicates if Redis supports Zstd compression.
Indicates if Redis supports Zstd compression.
protected bool|null $supportsZstd = null
| kind | source | summary |
|---|---|---|
| inherit | PhpRedisConnection::$supportsZstd | Indicates if Redis supports Zstd compression. |
[m] flushdb Flush the selected Redis database on all master nodes.
Flush the selected Redis database on all master nodes.
public function flushdb(): mixed
| type | summary |
|---|---|
| mixed | |
| kind | source | summary |
|---|---|---|
| override | PhpRedisConnection::flushdb() | Flush the selected Redis database. |
[m] __construct Create a new PhpRedis connection.
Create a new PhpRedis connection.
public function __construct( \Redis $client, ?callable|callable|null $connector = null, array $config = [] ): void
| type | name | summary |
|---|---|---|
| Redis | $client |
|
| ?callable|callable|null | $connector = null |
|
| array | $config = [] |
|
| type | summary |
|---|---|
| void | |
| kind | source | summary |
|---|---|---|
| inherit | PhpRedisConnection::__construct() | Create a new PhpRedis connection. |
[m] get Returns the value of the given key.
Returns the value of the given key.
public function get(string $key): string|null
| type | name | summary |
|---|---|---|
| string | $key |
|
| type | summary |
|---|---|
| string|null | |
| kind | source | summary |
|---|---|---|
| inherit | PhpRedisConnection::get() | Returns the value of the given key. |
[m] mget Get the values of all the given keys.
Get the values of all the given keys.
public function mget(array $keys): array
| type | name | summary |
|---|---|---|
| array | $keys |
|
| type | summary |
|---|---|
| array | |
| kind | source | summary |
|---|---|---|
| inherit | PhpRedisConnection::mget() | Get the values of all the given keys. |
[m] set Set the string value in the argument as the value of the key.
Set the string value in the argument as the value of the key.
public function set( string $key, mixed $value, string|null $expireResolution = null, int|null $expireTTL = null, string|null $flag = null ): bool
| type | name | summary |
|---|---|---|
| string | $key |
|
| mixed | $value |
|
| string|null | $expireResolution = null |
|
| int|null | $expireTTL = null |
|
| string|null | $flag = null |
|
| type | summary |
|---|---|
| bool | |
| kind | source | summary |
|---|---|---|
| inherit | PhpRedisConnection::set() | Set the string value in the argument as the value of the key. |
[m] setnx Set the given key if it doesn't exist.
Set the given key if it doesn't exist.
public function setnx( string $key, string $value ): int
| type | name | summary |
|---|---|---|
| string | $key |
|
| string | $value |
|
| type | summary |
|---|---|
| int | |
| kind | source | summary |
|---|---|---|
| inherit | PhpRedisConnection::setnx() | Set the given key if it doesn't exist. |
[m] hmget Get the value of the given hash fields.
Get the value of the given hash fields.
public function hmget( string $key, mixed ...$dictionary ): array
| type | name | summary |
|---|---|---|
| string | $key |
|
| mixed | ...$dictionary |
|
| type | summary |
|---|---|
| array | |
| kind | source | summary |
|---|---|---|
| inherit | PhpRedisConnection::hmget() | Get the value of the given hash fields. |
[m] hmset Set the given hash fields to their respective values.
Set the given hash fields to their respective values.
public function hmset( string $key, mixed ...$dictionary ): int
| type | name | summary |
|---|---|---|
| string | $key |
|
| mixed | ...$dictionary |
|
| type | summary |
|---|---|
| int | |
| kind | source | summary |
|---|---|---|
| inherit | PhpRedisConnection::hmset() | Set the given hash fields to their respective values. |
[m] hsetnx Set the given hash field if it doesn't exist.
Set the given hash field if it doesn't exist.
public function hsetnx( string $hash, string $key, string $value ): int
| type | name | summary |
|---|---|---|
| string | $hash |
|
| string | $key |
|
| string | $value |
|
| type | summary |
|---|---|
| int | |
| kind | source | summary |
|---|---|---|
| inherit | PhpRedisConnection::hsetnx() | Set the given hash field if it doesn't exist. |
[m] lrem Removes the first count occurrences of the value element from the list.
Removes the first count occurrences of the value element from the list.
public function lrem( string $key, int $count, mixed $value ): int|false
| type | name | summary |
|---|---|---|
| string | $key |
|
| int | $count |
|
| mixed | $value |
|
| type | summary |
|---|---|
| int|false | |
| kind | source | summary |
|---|---|---|
| inherit | PhpRedisConnection::lrem() | Removes the first count occurrences of the value element from the list. |
[m] blpop Removes and returns the first element of the list stored at key.
Removes and returns the first element of the list stored at key.
public function blpop(mixed ...$arguments): array|null
| type | name | summary |
|---|---|---|
| mixed | ...$arguments |
|
| type | summary |
|---|---|
| array|null | |
| kind | source | summary |
|---|---|---|
| inherit | PhpRedisConnection::blpop() | Removes and returns the first element of the list stored at key. |
[m] brpop Removes and returns the last element of the list stored at key.
Removes and returns the last element of the list stored at key.
public function brpop(mixed ...$arguments): array|null
| type | name | summary |
|---|---|---|
| mixed | ...$arguments |
|
| type | summary |
|---|---|
| array|null | |
| kind | source | summary |
|---|---|---|
| inherit | PhpRedisConnection::brpop() | Removes and returns the last element of the list stored at key. |
[m] spop Removes and returns a random element from the set value at key.
Removes and returns a random element from the set value at key.
public function spop( string $key, int|null $count = 1 ): mixed|false
| type | name | summary |
|---|---|---|
| string | $key |
|
| int|null | $count = 1 |
|
| type | summary |
|---|---|
| mixed|false | |
| kind | source | summary |
|---|---|---|
| inherit | PhpRedisConnection::spop() | Removes and returns a random element from the set value at key. |
[m] zadd Add one or more members to a sorted set or update its score if it already exists.
Add one or more members to a sorted set or update its score if it already exists.
public function zadd( string $key, mixed ...$dictionary ): int
| type | name | summary |
|---|---|---|
| string | $key |
|
| mixed | ...$dictionary |
|
| type | summary |
|---|---|
| int | |
| kind | source | summary |
|---|---|---|
| inherit | PhpRedisConnection::zadd() | Add one or more members to a sorted set or update its score if it already exists. |
[m] zrangebyscore Return elements with score between $min and $max.
Return elements with score between $min and $max.
public function zrangebyscore( string $key, mixed $min, mixed $max, array $options = [] ): array
| type | name | summary |
|---|---|---|
| string | $key |
|
| mixed | $min |
|
| mixed | $max |
|
| array | $options = [] |
|
| type | summary |
|---|---|
| array | |
| kind | source | summary |
|---|---|---|
| inherit | PhpRedisConnection::zrangebyscore() | Return elements with score between $min and $max. |
[m] zrevrangebyscore Return elements with score between $min and $max.
Return elements with score between $min and $max.
public function zrevrangebyscore( string $key, mixed $min, mixed $max, array $options = [] ): array
| type | name | summary |
|---|---|---|
| string | $key |
|
| mixed | $min |
|
| mixed | $max |
|
| array | $options = [] |
|
| type | summary |
|---|---|
| array | |
| kind | source | summary |
|---|---|---|
| inherit | PhpRedisConnection::zrevrangebyscore() | Return elements with score between $min and $max. |
[m] zinterstore Find the intersection between sets and store in a new set.
Find the intersection between sets and store in a new set.
public function zinterstore( string $output, array $keys, array $options = [] ): int
| type | name | summary |
|---|---|---|
| string | $output |
|
| array | $keys |
|
| array | $options = [] |
|
| type | summary |
|---|---|
| int | |
| kind | source | summary |
|---|---|---|
| inherit | PhpRedisConnection::zinterstore() | Find the intersection between sets and store in a new set. |
[m] zunionstore Find the union between sets and store in a new set.
Find the union between sets and store in a new set.
public function zunionstore( string $output, array $keys, array $options = [] ): int
| type | name | summary |
|---|---|---|
| string | $output |
|
| array | $keys |
|
| array | $options = [] |
|
| type | summary |
|---|---|
| int | |
| kind | source | summary |
|---|---|---|
| inherit | PhpRedisConnection::zunionstore() | Find the union between sets and store in a new set. |
[m] scan Scans all keys based on options.
Scans all keys based on options.
public function scan( mixed $cursor, array $options = [] ): mixed
| type | name | summary |
|---|---|---|
| mixed | $cursor |
|
| array | $options = [] |
|
| type | summary |
|---|---|
| mixed | |
| kind | source | summary |
|---|---|---|
| inherit | PhpRedisConnection::scan() | Scans all keys based on options. |
[m] zscan Scans the given set for all values based on options.
Scans the given set for all values based on options.
public function zscan( string $key, mixed $cursor, array $options = [] ): mixed
| type | name | summary |
|---|---|---|
| string | $key |
|
| mixed | $cursor |
|
| array | $options = [] |
|
| type | summary |
|---|---|
| mixed | |
| kind | source | summary |
|---|---|---|
| inherit | PhpRedisConnection::zscan() | Scans the given set for all values based on options. |
[m] hscan Scans the given hash for all values based on options.
Scans the given hash for all values based on options.
public function hscan( string $key, mixed $cursor, array $options = [] ): mixed
| type | name | summary |
|---|---|---|
| string | $key |
|
| mixed | $cursor |
|
| array | $options = [] |
|
| type | summary |
|---|---|
| mixed | |
| kind | source | summary |
|---|---|---|
| inherit | PhpRedisConnection::hscan() | Scans the given hash for all values based on options. |
[m] sscan Scans the given set for all values based on options.
Scans the given set for all values based on options.
public function sscan( string $key, mixed $cursor, array $options = [] ): mixed
| type | name | summary |
|---|---|---|
| string | $key |
|
| mixed | $cursor |
|
| array | $options = [] |
|
| type | summary |
|---|---|
| mixed | |
| kind | source | summary |
|---|---|---|
| inherit | PhpRedisConnection::sscan() | Scans the given set for all values based on options. |
[m] pipeline Execute commands in a pipeline.
Execute commands in a pipeline.
public function pipeline(?callable|callable|null $callback = null): \Redis|array
| type | name | summary |
|---|---|---|
| ?callable|callable|null | $callback = null |
|
| type | summary |
|---|---|
| Redis|array | |
| kind | source | summary |
|---|---|---|
| inherit | PhpRedisConnection::pipeline() | Execute commands in a pipeline. |
[m] transaction Execute commands in a transaction.
Execute commands in a transaction.
public function transaction(?callable|callable|null $callback = null): \Redis|array
| type | name | summary |
|---|---|---|
| ?callable|callable|null | $callback = null |
|
| type | summary |
|---|---|
| Redis|array | |
| kind | source | summary |
|---|---|---|
| inherit | PhpRedisConnection::transaction() | Execute commands in a transaction. |
[m] evalsha Evaluate a LUA script serverside, from the SHA1 hash of the script instead of the script itself.
Evaluate a LUA script serverside, from the SHA1 hash of the script instead of the script itself.
public function evalsha( string $script, int $numkeys, mixed ...$arguments ): mixed
| type | name | summary |
|---|---|---|
| string | $script |
|
| int | $numkeys |
|
| mixed | ...$arguments |
|
| type | summary |
|---|---|
| mixed | |
| kind | source | summary |
|---|---|---|
| inherit | PhpRedisConnection::evalsha() | Evaluate a LUA script serverside, from the SHA1 hash of the script instead of the script itself. |
[m] eval Evaluate a script and return its result.
Evaluate a script and return its result.
public function eval( string $script, int $numberOfKeys, dynamic ...$arguments ): mixed
| type | name | summary |
|---|---|---|
| string | $script |
|
| int | $numberOfKeys |
|
| dynamic | ...$arguments |
|
| type | summary |
|---|---|
| mixed | |
| kind | source | summary |
|---|---|---|
| inherit | PhpRedisConnection::eval() | Evaluate a script and return its result. |
[m] subscribe Subscribe to a set of given channels for messages.
Subscribe to a set of given channels for messages.
public function subscribe( array|string $channels, \Closure $callback ): void
| type | name | summary |
|---|---|---|
| array|string | $channels |
|
| Closure | $callback |
|
| type | summary |
|---|---|
| void | |
| kind | source | summary |
|---|---|---|
| inherit | PhpRedisConnection::subscribe() | Subscribe to a set of given channels for messages. |
[m] psubscribe Subscribe to a set of given channels with wildcards.
Subscribe to a set of given channels with wildcards.
public function psubscribe( array|string $channels, \Closure $callback ): void
| type | name | summary |
|---|---|---|
| array|string | $channels |
|
| Closure | $callback |
|
| type | summary |
|---|---|
| void | |
| kind | source | summary |
|---|---|---|
| inherit | PhpRedisConnection::psubscribe() | Subscribe to a set of given channels with wildcards. |
[m] createSubscription Subscribe to a set of given channels for messages.
Subscribe to a set of given channels for messages.
public function createSubscription( array|string $channels, \Closure $callback, string $method = "subscribe" ): void
| type | name | summary |
|---|---|---|
| array|string | $channels |
|
| Closure | $callback |
|
| string | $method = "subscribe" |
|
| type | summary |
|---|---|
| void | |
| kind | source | summary |
|---|---|---|
| inherit | PhpRedisConnection::createSubscription() | Subscribe to a set of given channels for messages. |
[m] executeRaw Execute a raw command.
Execute a raw command.
public function executeRaw(array $parameters): mixed
| type | name | summary |
|---|---|---|
| array | $parameters |
|
| type | summary |
|---|---|
| mixed | |
| kind | source | summary |
|---|---|---|
| inherit | PhpRedisConnection::executeRaw() | Execute a raw command. |
[m] command Run a command against the Redis database.
Run a command against the Redis database.
public function command( string $method, array $parameters = [] ): mixed
| type | name | summary |
|---|---|---|
| string | $method |
|
| array | $parameters = [] |
|
| type | summary |
|---|---|
| mixed | |
| type | summary |
|---|---|
| RedisException | |
| kind | source | summary |
|---|---|---|
| inherit | PhpRedisConnection::command() | Run a command against the Redis database. |
[m] disconnect Disconnects from the Redis instance.
Disconnects from the Redis instance.
public function disconnect(): void
| type | summary |
|---|---|
| void | |
| kind | source | summary |
|---|---|---|
| inherit | PhpRedisConnection::disconnect() | Disconnects from the Redis instance. |
[m] __call Pass other method calls down to the underlying client.
Pass other method calls down to the underlying client.
public function __call( string $method, array $parameters ): mixed
| type | name | summary |
|---|---|---|
| string | $method |
|
| array | $parameters |
|
| type | summary |
|---|---|
| mixed | |
| kind | source | summary |
|---|---|---|
| inherit | PhpRedisConnection::__call() | Pass other method calls down to the underlying client. |
[m] funnel Funnel a callback for a maximum number of simultaneous executions.
Funnel a callback for a maximum number of simultaneous executions.
public function funnel(string $name): Illuminate\Redis\Limiters\ConcurrencyLimiterBuilder
| type | name | summary |
|---|---|---|
| string | $name |
|
| type | summary |
|---|---|
| ConcurrencyLimiterBuilder | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::funnel() | Funnel a callback for a maximum number of simultaneous executions. |
[m] throttle Throttle a callback for a maximum number of executions over a given duration.
Throttle a callback for a maximum number of executions over a given duration.
public function throttle(string $name): Illuminate\Redis\Limiters\DurationLimiterBuilder
| type | name | summary |
|---|---|---|
| string | $name |
|
| type | summary |
|---|---|
| DurationLimiterBuilder | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::throttle() | Throttle a callback for a maximum number of executions over a given duration. |
[m] client Get the underlying Redis client.
Get the underlying Redis client.
public function client(): mixed
| type | summary |
|---|---|
| mixed | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::client() | Get the underlying Redis client. |
[m] event Fire the given event if possible.
Fire the given event if possible.
protected function event(mixed $event): void
| type | name | summary |
|---|---|---|
| mixed | $event |
|
| type | summary |
|---|---|
| void | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::event() | Fire the given event if possible. |
[m] listen Register a Redis command listener with the connection.
Register a Redis command listener with the connection.
public function listen(\Closure $callback): void
| type | name | summary |
|---|---|---|
| Closure | $callback |
|
| type | summary |
|---|---|
| void | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::listen() | Register a Redis command listener with the connection. |
[m] getName Get the connection name.
Get the connection name.
public function getName(): string|null
| type | summary |
|---|---|
| string|null | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::getName() | Get the connection name. |
[m] setName Set the connections name.
Set the connections name.
public function setName(string $name): Illuminate\Redis\Connections\Connection
| type | name | summary |
|---|---|---|
| string | $name |
|
| type | summary |
|---|---|
| Connection | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::setName() | Set the connections name. |
[m] getEventDispatcher Get the event dispatcher used by the connection.
Get the event dispatcher used by the connection.
public function getEventDispatcher(): Illuminate\Contracts\Events\Dispatcher
| type | summary |
|---|---|
| Dispatcher | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::getEventDispatcher() | Get the event dispatcher used by the connection. |
[m] setEventDispatcher Set the event dispatcher instance on the connection.
Set the event dispatcher instance on the connection.
public function setEventDispatcher(Illuminate\Contracts\Events\Dispatcher $events): void
| type | name | summary |
|---|---|---|
| Dispatcher | $events |
|
| type | summary |
|---|---|
| void | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::setEventDispatcher() | Set the event dispatcher instance on the connection. |
[m] unsetEventDispatcher Unset the event dispatcher instance on the connection.
Unset the event dispatcher instance on the connection.
public function unsetEventDispatcher(): void
| type | summary |
|---|---|
| void | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::unsetEventDispatcher() | Unset the event dispatcher instance on the connection. |
[M] macro Register a custom macro.
Register a custom macro.
public static function macro( string $name, object|callable $macro ): void
| type | name | summary |
|---|---|---|
| string | $name |
|
| object|callable | $macro |
|
| type | summary |
|---|---|
| void | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::macro() | Register a custom macro. |
[M] mixin Mix another object into the class.
Mix another object into the class.
public static function mixin( object $mixin, bool $replace = true ): void
| type | name | summary |
|---|---|---|
| object | $mixin |
|
| bool | $replace = true |
|
| type | summary |
|---|---|
| void | |
| type | summary |
|---|---|
| ReflectionException | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::mixin() | Mix another object into the class. |
[M] hasMacro Checks if macro is registered.
Checks if macro is registered.
public static function hasMacro(string $name): bool
| type | name | summary |
|---|---|---|
| string | $name |
|
| type | summary |
|---|---|
| bool | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::hasMacro() | Checks if macro is registered. |
[M] flushMacros Flush the existing macros.
Flush the existing macros.
public static function flushMacros(): void
| type | summary |
|---|---|
| void | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::flushMacros() | Flush the existing macros. |
[M] __callStatic Dynamically handle calls to the class.
Dynamically handle calls to the class.
public static function __callStatic( string $method, array $parameters ): mixed
| type | name | summary |
|---|---|---|
| string | $method |
|
| array | $parameters |
|
| type | summary |
|---|---|
| mixed | |
| type | summary |
|---|---|
| BadMethodCallException | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::__callStatic() | Dynamically handle calls to the class. |
[m] macroCall Dynamically handle calls to the class.
Dynamically handle calls to the class.
public function macroCall( string $method, array $parameters ): mixed
| type | name | summary |
|---|---|---|
| string | $method |
|
| array | $parameters |
|
| type | summary |
|---|---|
| mixed | |
| type | summary |
|---|---|
| BadMethodCallException | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::macroCall() | Dynamically handle calls to the class. |
[m] pack Prepares the given values to be used with the eval
command, including serialization and compression.
Prepares the given values to be used with the eval
command, including serialization and compression.
public function pack(array $values): array
| type | name | summary |
|---|---|---|
| array | $values |
|
| type | summary |
|---|---|
| array | |
| kind | source | summary |
|---|---|---|
| inherit | PhpRedisConnection::pack() | Prepares the given values to be used with the eval command, including serialization and compression. |
[m] compressed Determine if compression is enabled.
Determine if compression is enabled.
public function compressed(): bool
| type | summary |
|---|---|
| bool | |
| kind | source | summary |
|---|---|---|
| inherit | PhpRedisConnection::compressed() | Determine if compression is enabled. |
[m] lzfCompressed Determine if LZF compression is enabled.
Determine if LZF compression is enabled.
public function lzfCompressed(): bool
| type | summary |
|---|---|
| bool | |
| kind | source | summary |
|---|---|---|
| inherit | PhpRedisConnection::lzfCompressed() | Determine if LZF compression is enabled. |
[m] zstdCompressed Determine if ZSTD compression is enabled.
Determine if ZSTD compression is enabled.
public function zstdCompressed(): bool
| type | summary |
|---|---|
| bool | |
| kind | source | summary |
|---|---|---|
| inherit | PhpRedisConnection::zstdCompressed() | Determine if ZSTD compression is enabled. |
[m] lz4Compressed Determine if LZ4 compression is enabled.
Determine if LZ4 compression is enabled.
public function lz4Compressed(): bool
| type | summary |
|---|---|
| bool | |
| kind | source | summary |
|---|---|---|
| inherit | PhpRedisConnection::lz4Compressed() | Determine if LZ4 compression is enabled. |
[m] supportsPacking Determine if the current PhpRedis extension version supports packing.
Determine if the current PhpRedis extension version supports packing.
protected function supportsPacking(): bool
| type | summary |
|---|---|
| bool | |
| kind | source | summary |
|---|---|---|
| inherit | PhpRedisConnection::supportsPacking() | Determine if the current PhpRedis extension version supports packing. |
[m] supportsLzf Determine if the current PhpRedis extension version supports LZF compression.
Determine if the current PhpRedis extension version supports LZF compression.
protected function supportsLzf(): bool
| type | summary |
|---|---|
| bool | |
| kind | source | summary |
|---|---|---|
| inherit | PhpRedisConnection::supportsLzf() | Determine if the current PhpRedis extension version supports LZF compression. |
[m] supportsZstd Determine if the current PhpRedis extension version supports Zstd compression.
Determine if the current PhpRedis extension version supports Zstd compression.
protected function supportsZstd(): bool
| type | summary |
|---|---|
| bool | |
| kind | source | summary |
|---|---|---|
| inherit | PhpRedisConnection::supportsZstd() | Determine if the current PhpRedis extension version supports Zstd compression. |
[m] phpRedisVersionAtLeast Determine if the PhpRedis extension version is at least the given version.
Determine if the PhpRedis extension version is at least the given version.
protected function phpRedisVersionAtLeast(string $version): bool
| type | name | summary |
|---|---|---|
| string | $version |
|
| type | summary |
|---|---|
| bool | |
| kind | source | summary |
|---|---|---|
| inherit | PhpRedisConnection::phpRedisVersionAtLeast() | Determine if the PhpRedis extension version is at least the given version. |
[C] PhpRedisConnection
Hierarchy
| type | summary |
|---|---|
| Connection | |
| type | summary |
|---|---|
| Connection | |
| type | summary |
|---|---|
| PacksPhpRedisValues | |
[p] $connector The connection creation callback.
The connection creation callback.
protected callable $connector = null
[p] $config The connection configuration array.
The connection configuration array.
protected array $config = null
[p] $client The Redis client.
The Redis client.
protected \Redis $client = null
| kind | source | summary |
|---|---|---|
| inherit | Connection::$client | The Redis client. |
[p] $name The Redis connection name.
The Redis connection name.
protected string|null $name = null
| kind | source | summary |
|---|---|---|
| inherit | Connection::$name | The Redis connection name. |
[p] $events The event dispatcher instance.
The event dispatcher instance.
protected Illuminate\Contracts\Events\Dispatcher $events = null
| kind | source | summary |
|---|---|---|
| inherit | Connection::$events | The event dispatcher instance. |
[P] $macros The registered string macros.
The registered string macros.
protected static array $macros = []
| kind | source | summary |
|---|---|---|
| inherit | Connection::$macros | The registered string macros. |
[p] $supportsPacking Indicates if Redis supports packing.
Indicates if Redis supports packing.
protected bool|null $supportsPacking = null
| kind | source | summary |
|---|---|---|
| instead | PacksPhpRedisValues::$supportsPacking | Indicates if Redis supports packing. |
[p] $supportsLzf Indicates if Redis supports LZF compression.
Indicates if Redis supports LZF compression.
protected bool|null $supportsLzf = null
| kind | source | summary |
|---|---|---|
| instead | PacksPhpRedisValues::$supportsLzf | Indicates if Redis supports LZF compression. |
[p] $supportsZstd Indicates if Redis supports Zstd compression.
Indicates if Redis supports Zstd compression.
protected bool|null $supportsZstd = null
| kind | source | summary |
|---|---|---|
| instead | PacksPhpRedisValues::$supportsZstd | Indicates if Redis supports Zstd compression. |
[m] __construct Create a new PhpRedis connection.
Create a new PhpRedis connection.
public function __construct( \Redis $client, ?callable|callable|null $connector = null, array $config = [] ): void
| type | name | summary |
|---|---|---|
| Redis | $client |
|
| ?callable|callable|null | $connector = null |
|
| array | $config = [] |
|
| type | summary |
|---|---|
| void | |
[m] get Returns the value of the given key.
Returns the value of the given key.
public function get(string $key): string|null
| type | name | summary |
|---|---|---|
| string | $key |
|
| type | summary |
|---|---|
| string|null | |
[m] mget Get the values of all the given keys.
Get the values of all the given keys.
public function mget(array $keys): array
| type | name | summary |
|---|---|---|
| array | $keys |
|
| type | summary |
|---|---|
| array | |
[m] set Set the string value in the argument as the value of the key.
Set the string value in the argument as the value of the key.
public function set( string $key, mixed $value, string|null $expireResolution = null, int|null $expireTTL = null, string|null $flag = null ): bool
| type | name | summary |
|---|---|---|
| string | $key |
|
| mixed | $value |
|
| string|null | $expireResolution = null |
|
| int|null | $expireTTL = null |
|
| string|null | $flag = null |
|
| type | summary |
|---|---|
| bool | |
[m] setnx Set the given key if it doesn't exist.
Set the given key if it doesn't exist.
public function setnx( string $key, string $value ): int
| type | name | summary |
|---|---|---|
| string | $key |
|
| string | $value |
|
| type | summary |
|---|---|
| int | |
[m] hmget Get the value of the given hash fields.
Get the value of the given hash fields.
public function hmget( string $key, mixed ...$dictionary ): array
| type | name | summary |
|---|---|---|
| string | $key |
|
| mixed | ...$dictionary |
|
| type | summary |
|---|---|
| array | |
[m] hmset Set the given hash fields to their respective values.
Set the given hash fields to their respective values.
public function hmset( string $key, mixed ...$dictionary ): int
| type | name | summary |
|---|---|---|
| string | $key |
|
| mixed | ...$dictionary |
|
| type | summary |
|---|---|
| int | |
[m] hsetnx Set the given hash field if it doesn't exist.
Set the given hash field if it doesn't exist.
public function hsetnx( string $hash, string $key, string $value ): int
| type | name | summary |
|---|---|---|
| string | $hash |
|
| string | $key |
|
| string | $value |
|
| type | summary |
|---|---|
| int | |
[m] lrem Removes the first count occurrences of the value element from the list.
Removes the first count occurrences of the value element from the list.
public function lrem( string $key, int $count, mixed $value ): int|false
| type | name | summary |
|---|---|---|
| string | $key |
|
| int | $count |
|
| mixed | $value |
|
| type | summary |
|---|---|
| int|false | |
[m] blpop Removes and returns the first element of the list stored at key.
Removes and returns the first element of the list stored at key.
public function blpop(mixed ...$arguments): array|null
| type | name | summary |
|---|---|---|
| mixed | ...$arguments |
|
| type | summary |
|---|---|
| array|null | |
[m] brpop Removes and returns the last element of the list stored at key.
Removes and returns the last element of the list stored at key.
public function brpop(mixed ...$arguments): array|null
| type | name | summary |
|---|---|---|
| mixed | ...$arguments |
|
| type | summary |
|---|---|
| array|null | |
[m] spop Removes and returns a random element from the set value at key.
Removes and returns a random element from the set value at key.
public function spop( string $key, int|null $count = 1 ): mixed|false
| type | name | summary |
|---|---|---|
| string | $key |
|
| int|null | $count = 1 |
|
| type | summary |
|---|---|
| mixed|false | |
[m] zadd Add one or more members to a sorted set or update its score if it already exists.
Add one or more members to a sorted set or update its score if it already exists.
public function zadd( string $key, mixed ...$dictionary ): int
| type | name | summary |
|---|---|---|
| string | $key |
|
| mixed | ...$dictionary |
|
| type | summary |
|---|---|
| int | |
[m] zrangebyscore Return elements with score between $min and $max.
Return elements with score between $min and $max.
public function zrangebyscore( string $key, mixed $min, mixed $max, array $options = [] ): array
| type | name | summary |
|---|---|---|
| string | $key |
|
| mixed | $min |
|
| mixed | $max |
|
| array | $options = [] |
|
| type | summary |
|---|---|
| array | |
[m] zrevrangebyscore Return elements with score between $min and $max.
Return elements with score between $min and $max.
public function zrevrangebyscore( string $key, mixed $min, mixed $max, array $options = [] ): array
| type | name | summary |
|---|---|---|
| string | $key |
|
| mixed | $min |
|
| mixed | $max |
|
| array | $options = [] |
|
| type | summary |
|---|---|
| array | |
[m] zinterstore Find the intersection between sets and store in a new set.
Find the intersection between sets and store in a new set.
public function zinterstore( string $output, array $keys, array $options = [] ): int
| type | name | summary |
|---|---|---|
| string | $output |
|
| array | $keys |
|
| array | $options = [] |
|
| type | summary |
|---|---|
| int | |
[m] zunionstore Find the union between sets and store in a new set.
Find the union between sets and store in a new set.
public function zunionstore( string $output, array $keys, array $options = [] ): int
| type | name | summary |
|---|---|---|
| string | $output |
|
| array | $keys |
|
| array | $options = [] |
|
| type | summary |
|---|---|
| int | |
[m] scan Scans all keys based on options.
Scans all keys based on options.
public function scan( mixed $cursor, array $options = [] ): mixed
| type | name | summary |
|---|---|---|
| mixed | $cursor |
|
| array | $options = [] |
|
| type | summary |
|---|---|
| mixed | |
[m] zscan Scans the given set for all values based on options.
Scans the given set for all values based on options.
public function zscan( string $key, mixed $cursor, array $options = [] ): mixed
| type | name | summary |
|---|---|---|
| string | $key |
|
| mixed | $cursor |
|
| array | $options = [] |
|
| type | summary |
|---|---|
| mixed | |
[m] hscan Scans the given hash for all values based on options.
Scans the given hash for all values based on options.
public function hscan( string $key, mixed $cursor, array $options = [] ): mixed
| type | name | summary |
|---|---|---|
| string | $key |
|
| mixed | $cursor |
|
| array | $options = [] |
|
| type | summary |
|---|---|
| mixed | |
[m] sscan Scans the given set for all values based on options.
Scans the given set for all values based on options.
public function sscan( string $key, mixed $cursor, array $options = [] ): mixed
| type | name | summary |
|---|---|---|
| string | $key |
|
| mixed | $cursor |
|
| array | $options = [] |
|
| type | summary |
|---|---|
| mixed | |
[m] pipeline Execute commands in a pipeline.
Execute commands in a pipeline.
public function pipeline(?callable|callable|null $callback = null): \Redis|array
| type | name | summary |
|---|---|---|
| ?callable|callable|null | $callback = null |
|
| type | summary |
|---|---|
| Redis|array | |
[m] transaction Execute commands in a transaction.
Execute commands in a transaction.
public function transaction(?callable|callable|null $callback = null): \Redis|array
| type | name | summary |
|---|---|---|
| ?callable|callable|null | $callback = null |
|
| type | summary |
|---|---|
| Redis|array | |
[m] evalsha Evaluate a LUA script serverside, from the SHA1 hash of the script instead of the script itself.
Evaluate a LUA script serverside, from the SHA1 hash of the script instead of the script itself.
public function evalsha( string $script, int $numkeys, mixed ...$arguments ): mixed
| type | name | summary |
|---|---|---|
| string | $script |
|
| int | $numkeys |
|
| mixed | ...$arguments |
|
| type | summary |
|---|---|
| mixed | |
[m] eval Evaluate a script and return its result.
Evaluate a script and return its result.
public function eval( string $script, int $numberOfKeys, dynamic ...$arguments ): mixed
| type | name | summary |
|---|---|---|
| string | $script |
|
| int | $numberOfKeys |
|
| dynamic | ...$arguments |
|
| type | summary |
|---|---|
| mixed | |
[m] subscribe Subscribe to a set of given channels for messages.
Subscribe to a set of given channels for messages.
public function subscribe( array|string $channels, \Closure $callback ): void
| type | name | summary |
|---|---|---|
| array|string | $channels |
|
| Closure | $callback |
|
| type | summary |
|---|---|
| void | |
| kind | source | summary |
|---|---|---|
| implement | Connection::subscribe() | |
[m] psubscribe Subscribe to a set of given channels with wildcards.
Subscribe to a set of given channels with wildcards.
public function psubscribe( array|string $channels, \Closure $callback ): void
| type | name | summary |
|---|---|---|
| array|string | $channels |
|
| Closure | $callback |
|
| type | summary |
|---|---|
| void | |
| kind | source | summary |
|---|---|---|
| implement | Connection::psubscribe() | |
[m] createSubscription Subscribe to a set of given channels for messages.
Subscribe to a set of given channels for messages.
public function createSubscription( array|string $channels, \Closure $callback, string $method = "subscribe" ): void
| type | name | summary |
|---|---|---|
| array|string | $channels |
|
| Closure | $callback |
|
| string | $method = "subscribe" |
|
| type | summary |
|---|---|
| void | |
| kind | source | summary |
|---|---|---|
| override | Connection::createSubscription() | Subscribe to a set of given channels for messages. |
[m] flushdb Flush the selected Redis database.
Flush the selected Redis database.
public function flushdb(): mixed
| type | summary |
|---|---|
| mixed | |
[m] executeRaw Execute a raw command.
Execute a raw command.
public function executeRaw(array $parameters): mixed
| type | name | summary |
|---|---|---|
| array | $parameters |
|
| type | summary |
|---|---|
| mixed | |
[m] command Run a command against the Redis database.
Run a command against the Redis database.
public function command( string $method, array $parameters = [] ): mixed
| type | name | summary |
|---|---|---|
| string | $method |
|
| array | $parameters = [] |
|
| type | summary |
|---|---|
| mixed | |
| type | summary |
|---|---|
| RedisException | |
| kind | source | summary |
|---|---|---|
| implement | Connection::command() | |
[m] disconnect Disconnects from the Redis instance.
Disconnects from the Redis instance.
public function disconnect(): void
| type | summary |
|---|---|
| void | |
[m] applyPrefix Apply a prefix to the given key if necessary.
Apply a prefix to the given key if necessary.
private function applyPrefix(string $key): string
| type | name | summary |
|---|---|---|
| string | $key |
|
| type | summary |
|---|---|
| string | |
[m] __call Pass other method calls down to the underlying client.
Pass other method calls down to the underlying client.
public function __call( string $method, array $parameters ): mixed
| type | name | summary |
|---|---|---|
| string | $method |
|
| array | $parameters |
|
| type | summary |
|---|---|
| mixed | |
| kind | source | summary |
|---|---|---|
| override | Connection::__call() | Pass other method calls down to the underlying client. |
[m] funnel Funnel a callback for a maximum number of simultaneous executions.
Funnel a callback for a maximum number of simultaneous executions.
public function funnel(string $name): Illuminate\Redis\Limiters\ConcurrencyLimiterBuilder
| type | name | summary |
|---|---|---|
| string | $name |
|
| type | summary |
|---|---|
| ConcurrencyLimiterBuilder | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::funnel() | Funnel a callback for a maximum number of simultaneous executions. |
[m] throttle Throttle a callback for a maximum number of executions over a given duration.
Throttle a callback for a maximum number of executions over a given duration.
public function throttle(string $name): Illuminate\Redis\Limiters\DurationLimiterBuilder
| type | name | summary |
|---|---|---|
| string | $name |
|
| type | summary |
|---|---|
| DurationLimiterBuilder | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::throttle() | Throttle a callback for a maximum number of executions over a given duration. |
[m] client Get the underlying Redis client.
Get the underlying Redis client.
public function client(): mixed
| type | summary |
|---|---|
| mixed | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::client() | Get the underlying Redis client. |
[m] event Fire the given event if possible.
Fire the given event if possible.
protected function event(mixed $event): void
| type | name | summary |
|---|---|---|
| mixed | $event |
|
| type | summary |
|---|---|
| void | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::event() | Fire the given event if possible. |
[m] listen Register a Redis command listener with the connection.
Register a Redis command listener with the connection.
public function listen(\Closure $callback): void
| type | name | summary |
|---|---|---|
| Closure | $callback |
|
| type | summary |
|---|---|
| void | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::listen() | Register a Redis command listener with the connection. |
[m] getName Get the connection name.
Get the connection name.
public function getName(): string|null
| type | summary |
|---|---|
| string|null | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::getName() | Get the connection name. |
[m] setName Set the connections name.
Set the connections name.
public function setName(string $name): Illuminate\Redis\Connections\Connection
| type | name | summary |
|---|---|---|
| string | $name |
|
| type | summary |
|---|---|
| Connection | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::setName() | Set the connections name. |
[m] getEventDispatcher Get the event dispatcher used by the connection.
Get the event dispatcher used by the connection.
public function getEventDispatcher(): Illuminate\Contracts\Events\Dispatcher
| type | summary |
|---|---|
| Dispatcher | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::getEventDispatcher() | Get the event dispatcher used by the connection. |
[m] setEventDispatcher Set the event dispatcher instance on the connection.
Set the event dispatcher instance on the connection.
public function setEventDispatcher(Illuminate\Contracts\Events\Dispatcher $events): void
| type | name | summary |
|---|---|---|
| Dispatcher | $events |
|
| type | summary |
|---|---|
| void | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::setEventDispatcher() | Set the event dispatcher instance on the connection. |
[m] unsetEventDispatcher Unset the event dispatcher instance on the connection.
Unset the event dispatcher instance on the connection.
public function unsetEventDispatcher(): void
| type | summary |
|---|---|
| void | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::unsetEventDispatcher() | Unset the event dispatcher instance on the connection. |
[M] macro Register a custom macro.
Register a custom macro.
public static function macro( string $name, object|callable $macro ): void
| type | name | summary |
|---|---|---|
| string | $name |
|
| object|callable | $macro |
|
| type | summary |
|---|---|
| void | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::macro() | Register a custom macro. |
[M] mixin Mix another object into the class.
Mix another object into the class.
public static function mixin( object $mixin, bool $replace = true ): void
| type | name | summary |
|---|---|---|
| object | $mixin |
|
| bool | $replace = true |
|
| type | summary |
|---|---|
| void | |
| type | summary |
|---|---|
| ReflectionException | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::mixin() | Mix another object into the class. |
[M] hasMacro Checks if macro is registered.
Checks if macro is registered.
public static function hasMacro(string $name): bool
| type | name | summary |
|---|---|---|
| string | $name |
|
| type | summary |
|---|---|
| bool | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::hasMacro() | Checks if macro is registered. |
[M] flushMacros Flush the existing macros.
Flush the existing macros.
public static function flushMacros(): void
| type | summary |
|---|---|
| void | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::flushMacros() | Flush the existing macros. |
[M] __callStatic Dynamically handle calls to the class.
Dynamically handle calls to the class.
public static function __callStatic( string $method, array $parameters ): mixed
| type | name | summary |
|---|---|---|
| string | $method |
|
| array | $parameters |
|
| type | summary |
|---|---|
| mixed | |
| type | summary |
|---|---|
| BadMethodCallException | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::__callStatic() | Dynamically handle calls to the class. |
[m] macroCall Dynamically handle calls to the class.
Dynamically handle calls to the class.
public function macroCall( string $method, array $parameters ): mixed
| type | name | summary |
|---|---|---|
| string | $method |
|
| array | $parameters |
|
| type | summary |
|---|---|
| mixed | |
| type | summary |
|---|---|
| BadMethodCallException | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::macroCall() | Dynamically handle calls to the class. |
[m] pack Prepares the given values to be used with the eval
command, including serialization and compression.
Prepares the given values to be used with the eval
command, including serialization and compression.
public function pack(array $values): array
| type | name | summary |
|---|---|---|
| array | $values |
|
| type | summary |
|---|---|
| array | |
| kind | source | summary |
|---|---|---|
| instead | PacksPhpRedisValues::pack() | Prepares the given values to be used with the eval command, including serialization and compression. |
[m] compressed Determine if compression is enabled.
Determine if compression is enabled.
public function compressed(): bool
| type | summary |
|---|---|
| bool | |
| kind | source | summary |
|---|---|---|
| instead | PacksPhpRedisValues::compressed() | Determine if compression is enabled. |
[m] lzfCompressed Determine if LZF compression is enabled.
Determine if LZF compression is enabled.
public function lzfCompressed(): bool
| type | summary |
|---|---|
| bool | |
| kind | source | summary |
|---|---|---|
| instead | PacksPhpRedisValues::lzfCompressed() | Determine if LZF compression is enabled. |
[m] zstdCompressed Determine if ZSTD compression is enabled.
Determine if ZSTD compression is enabled.
public function zstdCompressed(): bool
| type | summary |
|---|---|
| bool | |
| kind | source | summary |
|---|---|---|
| instead | PacksPhpRedisValues::zstdCompressed() | Determine if ZSTD compression is enabled. |
[m] lz4Compressed Determine if LZ4 compression is enabled.
Determine if LZ4 compression is enabled.
public function lz4Compressed(): bool
| type | summary |
|---|---|
| bool | |
| kind | source | summary |
|---|---|---|
| instead | PacksPhpRedisValues::lz4Compressed() | Determine if LZ4 compression is enabled. |
[m] supportsPacking Determine if the current PhpRedis extension version supports packing.
Determine if the current PhpRedis extension version supports packing.
protected function supportsPacking(): bool
| type | summary |
|---|---|
| bool | |
| kind | source | summary |
|---|---|---|
| instead | PacksPhpRedisValues::supportsPacking() | Determine if the current PhpRedis extension version supports packing. |
[m] supportsLzf Determine if the current PhpRedis extension version supports LZF compression.
Determine if the current PhpRedis extension version supports LZF compression.
protected function supportsLzf(): bool
| type | summary |
|---|---|
| bool | |
| kind | source | summary |
|---|---|---|
| instead | PacksPhpRedisValues::supportsLzf() | Determine if the current PhpRedis extension version supports LZF compression. |
[m] supportsZstd Determine if the current PhpRedis extension version supports Zstd compression.
Determine if the current PhpRedis extension version supports Zstd compression.
protected function supportsZstd(): bool
| type | summary |
|---|---|
| bool | |
| kind | source | summary |
|---|---|---|
| instead | PacksPhpRedisValues::supportsZstd() | Determine if the current PhpRedis extension version supports Zstd compression. |
[m] phpRedisVersionAtLeast Determine if the PhpRedis extension version is at least the given version.
Determine if the PhpRedis extension version is at least the given version.
protected function phpRedisVersionAtLeast(string $version): bool
| type | name | summary |
|---|---|---|
| string | $version |
|
| type | summary |
|---|---|
| bool | |
| kind | source | summary |
|---|---|---|
| instead | PacksPhpRedisValues::phpRedisVersionAtLeast() | Determine if the PhpRedis extension version is at least the given version. |
[C] PredisClusterConnection
Hierarchy
| type | summary |
|---|---|
| PredisConnection | |
| Connection | |
| type | summary |
|---|---|
| Connection | |
[p] $client The Predis client.
The Predis client.
protected Predis\Client $client = null
| kind | source | summary |
|---|---|---|
| inherit | PredisConnection::$client | The Predis client. |
[p] $name The Redis connection name.
The Redis connection name.
protected string|null $name = null
| kind | source | summary |
|---|---|---|
| inherit | Connection::$name | The Redis connection name. |
[p] $events The event dispatcher instance.
The event dispatcher instance.
protected Illuminate\Contracts\Events\Dispatcher $events = null
| kind | source | summary |
|---|---|---|
| inherit | Connection::$events | The event dispatcher instance. |
[P] $macros The registered string macros.
The registered string macros.
protected static array $macros = []
| kind | source | summary |
|---|---|---|
| inherit | Connection::$macros | The registered string macros. |
[m] flushdb Flush the selected Redis database on all cluster nodes.
Flush the selected Redis database on all cluster nodes.
public function flushdb(): void
| type | summary |
|---|---|
| void | |
[m] __construct Create a new Predis connection.
Create a new Predis connection.
public function __construct(Predis\Client $client): void
| type | name | summary |
|---|---|---|
| Client | $client |
|
| type | summary |
|---|---|
| void | |
| kind | source | summary |
|---|---|---|
| inherit | PredisConnection::__construct() | Create a new Predis connection. |
[m] createSubscription Subscribe to a set of given channels for messages.
Subscribe to a set of given channels for messages.
public function createSubscription( array|string $channels, \Closure $callback, string $method = "subscribe" ): void
| type | name | summary |
|---|---|---|
| array|string | $channels |
|
| Closure | $callback |
|
| string | $method = "subscribe" |
|
| type | summary |
|---|---|
| void | |
| kind | source | summary |
|---|---|---|
| inherit | PredisConnection::createSubscription() | Subscribe to a set of given channels for messages. |
[m] funnel Funnel a callback for a maximum number of simultaneous executions.
Funnel a callback for a maximum number of simultaneous executions.
public function funnel(string $name): Illuminate\Redis\Limiters\ConcurrencyLimiterBuilder
| type | name | summary |
|---|---|---|
| string | $name |
|
| type | summary |
|---|---|
| ConcurrencyLimiterBuilder | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::funnel() | Funnel a callback for a maximum number of simultaneous executions. |
[m] throttle Throttle a callback for a maximum number of executions over a given duration.
Throttle a callback for a maximum number of executions over a given duration.
public function throttle(string $name): Illuminate\Redis\Limiters\DurationLimiterBuilder
| type | name | summary |
|---|---|---|
| string | $name |
|
| type | summary |
|---|---|
| DurationLimiterBuilder | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::throttle() | Throttle a callback for a maximum number of executions over a given duration. |
[m] client Get the underlying Redis client.
Get the underlying Redis client.
public function client(): mixed
| type | summary |
|---|---|
| mixed | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::client() | Get the underlying Redis client. |
[m] subscribe Subscribe to a set of given channels for messages.
Subscribe to a set of given channels for messages.
public function subscribe( array|string $channels, \Closure $callback ): void
| type | name | summary |
|---|---|---|
| array|string | $channels |
|
| Closure | $callback |
|
| type | summary |
|---|---|
| void | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::subscribe() | Subscribe to a set of given channels for messages. |
[m] psubscribe Subscribe to a set of given channels with wildcards.
Subscribe to a set of given channels with wildcards.
public function psubscribe( array|string $channels, \Closure $callback ): void
| type | name | summary |
|---|---|---|
| array|string | $channels |
|
| Closure | $callback |
|
| type | summary |
|---|---|
| void | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::psubscribe() | Subscribe to a set of given channels with wildcards. |
[m] command Run a command against the Redis database.
Run a command against the Redis database.
public function command( string $method, array $parameters = [] ): mixed
| type | name | summary |
|---|---|---|
| string | $method |
|
| array | $parameters = [] |
|
| type | summary |
|---|---|
| mixed | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::command() | Run a command against the Redis database. |
[m] event Fire the given event if possible.
Fire the given event if possible.
protected function event(mixed $event): void
| type | name | summary |
|---|---|---|
| mixed | $event |
|
| type | summary |
|---|---|
| void | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::event() | Fire the given event if possible. |
[m] listen Register a Redis command listener with the connection.
Register a Redis command listener with the connection.
public function listen(\Closure $callback): void
| type | name | summary |
|---|---|---|
| Closure | $callback |
|
| type | summary |
|---|---|
| void | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::listen() | Register a Redis command listener with the connection. |
[m] getName Get the connection name.
Get the connection name.
public function getName(): string|null
| type | summary |
|---|---|
| string|null | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::getName() | Get the connection name. |
[m] setName Set the connections name.
Set the connections name.
public function setName(string $name): Illuminate\Redis\Connections\Connection
| type | name | summary |
|---|---|---|
| string | $name |
|
| type | summary |
|---|---|
| Connection | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::setName() | Set the connections name. |
[m] getEventDispatcher Get the event dispatcher used by the connection.
Get the event dispatcher used by the connection.
public function getEventDispatcher(): Illuminate\Contracts\Events\Dispatcher
| type | summary |
|---|---|
| Dispatcher | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::getEventDispatcher() | Get the event dispatcher used by the connection. |
[m] setEventDispatcher Set the event dispatcher instance on the connection.
Set the event dispatcher instance on the connection.
public function setEventDispatcher(Illuminate\Contracts\Events\Dispatcher $events): void
| type | name | summary |
|---|---|---|
| Dispatcher | $events |
|
| type | summary |
|---|---|
| void | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::setEventDispatcher() | Set the event dispatcher instance on the connection. |
[m] unsetEventDispatcher Unset the event dispatcher instance on the connection.
Unset the event dispatcher instance on the connection.
public function unsetEventDispatcher(): void
| type | summary |
|---|---|
| void | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::unsetEventDispatcher() | Unset the event dispatcher instance on the connection. |
[m] __call Pass other method calls down to the underlying client.
Pass other method calls down to the underlying client.
public function __call( string $method, array $parameters ): mixed
| type | name | summary |
|---|---|---|
| string | $method |
|
| array | $parameters |
|
| type | summary |
|---|---|
| mixed | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::__call() | Pass other method calls down to the underlying client. |
[M] macro Register a custom macro.
Register a custom macro.
public static function macro( string $name, object|callable $macro ): void
| type | name | summary |
|---|---|---|
| string | $name |
|
| object|callable | $macro |
|
| type | summary |
|---|---|
| void | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::macro() | Register a custom macro. |
[M] mixin Mix another object into the class.
Mix another object into the class.
public static function mixin( object $mixin, bool $replace = true ): void
| type | name | summary |
|---|---|---|
| object | $mixin |
|
| bool | $replace = true |
|
| type | summary |
|---|---|
| void | |
| type | summary |
|---|---|
| ReflectionException | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::mixin() | Mix another object into the class. |
[M] hasMacro Checks if macro is registered.
Checks if macro is registered.
public static function hasMacro(string $name): bool
| type | name | summary |
|---|---|---|
| string | $name |
|
| type | summary |
|---|---|
| bool | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::hasMacro() | Checks if macro is registered. |
[M] flushMacros Flush the existing macros.
Flush the existing macros.
public static function flushMacros(): void
| type | summary |
|---|---|
| void | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::flushMacros() | Flush the existing macros. |
[M] __callStatic Dynamically handle calls to the class.
Dynamically handle calls to the class.
public static function __callStatic( string $method, array $parameters ): mixed
| type | name | summary |
|---|---|---|
| string | $method |
|
| array | $parameters |
|
| type | summary |
|---|---|
| mixed | |
| type | summary |
|---|---|
| BadMethodCallException | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::__callStatic() | Dynamically handle calls to the class. |
[m] macroCall Dynamically handle calls to the class.
Dynamically handle calls to the class.
public function macroCall( string $method, array $parameters ): mixed
| type | name | summary |
|---|---|---|
| string | $method |
|
| array | $parameters |
|
| type | summary |
|---|---|
| mixed | |
| type | summary |
|---|---|
| BadMethodCallException | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::macroCall() | Dynamically handle calls to the class. |
[C] PredisConnection
Hierarchy
| type | summary |
|---|---|
| Connection | |
| type | summary |
|---|---|
| Connection | |
[p] $client The Predis client.
The Predis client.
protected Predis\Client $client = null
| kind | source | summary |
|---|---|---|
| override | Connection::$client | The Redis client. |
[p] $name The Redis connection name.
The Redis connection name.
protected string|null $name = null
| kind | source | summary |
|---|---|---|
| inherit | Connection::$name | The Redis connection name. |
[p] $events The event dispatcher instance.
The event dispatcher instance.
protected Illuminate\Contracts\Events\Dispatcher $events = null
| kind | source | summary |
|---|---|---|
| inherit | Connection::$events | The event dispatcher instance. |
[P] $macros The registered string macros.
The registered string macros.
protected static array $macros = []
| kind | source | summary |
|---|---|---|
| inherit | Connection::$macros | The registered string macros. |
[m] __construct Create a new Predis connection.
Create a new Predis connection.
public function __construct(Predis\Client $client): void
| type | name | summary |
|---|---|---|
| Client | $client |
|
| type | summary |
|---|---|
| void | |
[m] createSubscription Subscribe to a set of given channels for messages.
Subscribe to a set of given channels for messages.
public function createSubscription( array|string $channels, \Closure $callback, string $method = "subscribe" ): void
| type | name | summary |
|---|---|---|
| array|string | $channels |
|
| Closure | $callback |
|
| string | $method = "subscribe" |
|
| type | summary |
|---|---|
| void | |
| kind | source | summary |
|---|---|---|
| override | Connection::createSubscription() | Subscribe to a set of given channels for messages. |
[m] funnel Funnel a callback for a maximum number of simultaneous executions.
Funnel a callback for a maximum number of simultaneous executions.
public function funnel(string $name): Illuminate\Redis\Limiters\ConcurrencyLimiterBuilder
| type | name | summary |
|---|---|---|
| string | $name |
|
| type | summary |
|---|---|
| ConcurrencyLimiterBuilder | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::funnel() | Funnel a callback for a maximum number of simultaneous executions. |
[m] throttle Throttle a callback for a maximum number of executions over a given duration.
Throttle a callback for a maximum number of executions over a given duration.
public function throttle(string $name): Illuminate\Redis\Limiters\DurationLimiterBuilder
| type | name | summary |
|---|---|---|
| string | $name |
|
| type | summary |
|---|---|
| DurationLimiterBuilder | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::throttle() | Throttle a callback for a maximum number of executions over a given duration. |
[m] client Get the underlying Redis client.
Get the underlying Redis client.
public function client(): mixed
| type | summary |
|---|---|
| mixed | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::client() | Get the underlying Redis client. |
[m] subscribe Subscribe to a set of given channels for messages.
Subscribe to a set of given channels for messages.
public function subscribe( array|string $channels, \Closure $callback ): void
| type | name | summary |
|---|---|---|
| array|string | $channels |
|
| Closure | $callback |
|
| type | summary |
|---|---|
| void | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::subscribe() | Subscribe to a set of given channels for messages. |
[m] psubscribe Subscribe to a set of given channels with wildcards.
Subscribe to a set of given channels with wildcards.
public function psubscribe( array|string $channels, \Closure $callback ): void
| type | name | summary |
|---|---|---|
| array|string | $channels |
|
| Closure | $callback |
|
| type | summary |
|---|---|
| void | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::psubscribe() | Subscribe to a set of given channels with wildcards. |
[m] command Run a command against the Redis database.
Run a command against the Redis database.
public function command( string $method, array $parameters = [] ): mixed
| type | name | summary |
|---|---|---|
| string | $method |
|
| array | $parameters = [] |
|
| type | summary |
|---|---|
| mixed | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::command() | Run a command against the Redis database. |
[m] event Fire the given event if possible.
Fire the given event if possible.
protected function event(mixed $event): void
| type | name | summary |
|---|---|---|
| mixed | $event |
|
| type | summary |
|---|---|
| void | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::event() | Fire the given event if possible. |
[m] listen Register a Redis command listener with the connection.
Register a Redis command listener with the connection.
public function listen(\Closure $callback): void
| type | name | summary |
|---|---|---|
| Closure | $callback |
|
| type | summary |
|---|---|
| void | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::listen() | Register a Redis command listener with the connection. |
[m] getName Get the connection name.
Get the connection name.
public function getName(): string|null
| type | summary |
|---|---|
| string|null | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::getName() | Get the connection name. |
[m] setName Set the connections name.
Set the connections name.
public function setName(string $name): Illuminate\Redis\Connections\Connection
| type | name | summary |
|---|---|---|
| string | $name |
|
| type | summary |
|---|---|
| Connection | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::setName() | Set the connections name. |
[m] getEventDispatcher Get the event dispatcher used by the connection.
Get the event dispatcher used by the connection.
public function getEventDispatcher(): Illuminate\Contracts\Events\Dispatcher
| type | summary |
|---|---|
| Dispatcher | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::getEventDispatcher() | Get the event dispatcher used by the connection. |
[m] setEventDispatcher Set the event dispatcher instance on the connection.
Set the event dispatcher instance on the connection.
public function setEventDispatcher(Illuminate\Contracts\Events\Dispatcher $events): void
| type | name | summary |
|---|---|---|
| Dispatcher | $events |
|
| type | summary |
|---|---|
| void | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::setEventDispatcher() | Set the event dispatcher instance on the connection. |
[m] unsetEventDispatcher Unset the event dispatcher instance on the connection.
Unset the event dispatcher instance on the connection.
public function unsetEventDispatcher(): void
| type | summary |
|---|---|
| void | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::unsetEventDispatcher() | Unset the event dispatcher instance on the connection. |
[m] __call Pass other method calls down to the underlying client.
Pass other method calls down to the underlying client.
public function __call( string $method, array $parameters ): mixed
| type | name | summary |
|---|---|---|
| string | $method |
|
| array | $parameters |
|
| type | summary |
|---|---|
| mixed | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::__call() | Pass other method calls down to the underlying client. |
[M] macro Register a custom macro.
Register a custom macro.
public static function macro( string $name, object|callable $macro ): void
| type | name | summary |
|---|---|---|
| string | $name |
|
| object|callable | $macro |
|
| type | summary |
|---|---|
| void | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::macro() | Register a custom macro. |
[M] mixin Mix another object into the class.
Mix another object into the class.
public static function mixin( object $mixin, bool $replace = true ): void
| type | name | summary |
|---|---|---|
| object | $mixin |
|
| bool | $replace = true |
|
| type | summary |
|---|---|
| void | |
| type | summary |
|---|---|
| ReflectionException | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::mixin() | Mix another object into the class. |
[M] hasMacro Checks if macro is registered.
Checks if macro is registered.
public static function hasMacro(string $name): bool
| type | name | summary |
|---|---|---|
| string | $name |
|
| type | summary |
|---|---|
| bool | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::hasMacro() | Checks if macro is registered. |
[M] flushMacros Flush the existing macros.
Flush the existing macros.
public static function flushMacros(): void
| type | summary |
|---|---|
| void | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::flushMacros() | Flush the existing macros. |
[M] __callStatic Dynamically handle calls to the class.
Dynamically handle calls to the class.
public static function __callStatic( string $method, array $parameters ): mixed
| type | name | summary |
|---|---|---|
| string | $method |
|
| array | $parameters |
|
| type | summary |
|---|---|
| mixed | |
| type | summary |
|---|---|
| BadMethodCallException | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::__callStatic() | Dynamically handle calls to the class. |
[m] macroCall Dynamically handle calls to the class.
Dynamically handle calls to the class.
public function macroCall( string $method, array $parameters ): mixed
| type | name | summary |
|---|---|---|
| string | $method |
|
| array | $parameters |
|
| type | summary |
|---|---|
| mixed | |
| type | summary |
|---|---|
| BadMethodCallException | |
| kind | source | summary |
|---|---|---|
| inherit | Connection::macroCall() | Dynamically handle calls to the class. |
[T] PacksPhpRedisValues
Hierarchy
[p] $supportsPacking Indicates if Redis supports packing.
Indicates if Redis supports packing.
protected bool|null $supportsPacking = null
[p] $supportsLzf Indicates if Redis supports LZF compression.
Indicates if Redis supports LZF compression.
protected bool|null $supportsLzf = null
[p] $supportsZstd Indicates if Redis supports Zstd compression.
Indicates if Redis supports Zstd compression.
protected bool|null $supportsZstd = null
[m] pack Prepares the given values to be used with the eval
command, including serialization and compression.
Prepares the given values to be used with the eval
command, including serialization and compression.
public function pack(array $values): array
| type | name | summary |
|---|---|---|
| array | $values |
|
| type | summary |
|---|---|
| array | |
[m] compressed Determine if compression is enabled.
Determine if compression is enabled.
public function compressed(): bool
| type | summary |
|---|---|
| bool | |
[m] lzfCompressed Determine if LZF compression is enabled.
Determine if LZF compression is enabled.
public function lzfCompressed(): bool
| type | summary |
|---|---|
| bool | |
[m] zstdCompressed Determine if ZSTD compression is enabled.
Determine if ZSTD compression is enabled.
public function zstdCompressed(): bool
| type | summary |
|---|---|
| bool | |
[m] lz4Compressed Determine if LZ4 compression is enabled.
Determine if LZ4 compression is enabled.
public function lz4Compressed(): bool
| type | summary |
|---|---|
| bool | |
[m] supportsPacking Determine if the current PhpRedis extension version supports packing.
Determine if the current PhpRedis extension version supports packing.
protected function supportsPacking(): bool
| type | summary |
|---|---|
| bool | |
[m] supportsLzf Determine if the current PhpRedis extension version supports LZF compression.
Determine if the current PhpRedis extension version supports LZF compression.
protected function supportsLzf(): bool
| type | summary |
|---|---|
| bool | |
[m] supportsZstd Determine if the current PhpRedis extension version supports Zstd compression.
Determine if the current PhpRedis extension version supports Zstd compression.
protected function supportsZstd(): bool
| type | summary |
|---|---|
| bool | |
[m] phpRedisVersionAtLeast Determine if the PhpRedis extension version is at least the given version.
Determine if the PhpRedis extension version is at least the given version.
protected function phpRedisVersionAtLeast(string $version): bool
| type | name | summary |
|---|---|---|
| string | $version |
|
| type | summary |
|---|---|
| bool | |
[N] Illuminate\Redis\Connectors\
[C] PhpRedisConnector
| type | summary |
|---|---|
| Connector | |
[m] connect Create a new clustered PhpRedis connection.
Create a new clustered PhpRedis connection.
public function connect( array $config, array $options ): Illuminate\Redis\Connections\PhpRedisConnection
| type | name | summary |
|---|---|---|
| array | $config |
|
| array | $options |
|
| type | summary |
|---|---|
| PhpRedisConnection | |
| kind | source | summary |
|---|---|---|
| implement | Connector::connect() | |
[m] connectToCluster Create a new clustered PhpRedis connection.
Create a new clustered PhpRedis connection.
public function connectToCluster( array $config, array $clusterOptions, array $options ): Illuminate\Redis\Connections\PhpRedisClusterConnection
| type | name | summary |
|---|---|---|
| array | $config |
|
| array | $clusterOptions |
|
| array | $options |
|
| type | summary |
|---|---|
| PhpRedisClusterConnection | |
| kind | source | summary |
|---|---|---|
| implement | Connector::connectToCluster() | |
[m] buildClusterConnectionString Build a single cluster seed string from an array.
Build a single cluster seed string from an array.
protected function buildClusterConnectionString(array $server): string
| type | name | summary |
|---|---|---|
| array | $server |
|
| type | summary |
|---|---|
| string | |
[m] createClient Create the Redis client instance.
Create the Redis client instance.
protected function createClient(array $config): \Redis
| type | name | summary |
|---|---|---|
| array | $config |
|
| type | summary |
|---|---|
| Redis | |
| type | summary |
|---|---|
| LogicException | |
[m] establishConnection Establish a connection with the Redis host.
Establish a connection with the Redis host.
protected function establishConnection( \Redis $client, array $config ): void
| type | name | summary |
|---|---|---|
| Redis | $client |
|
| array | $config |
|
| type | summary |
|---|---|
| void | |
[m] createRedisClusterInstance Create a new redis cluster instance.
Create a new redis cluster instance.
protected function createRedisClusterInstance( array $servers, array $options ): \RedisCluster
| type | name | summary |
|---|---|---|
| array | $servers |
|
| array | $options |
|
| type | summary |
|---|---|
| RedisCluster | |
[m] formatHost Format the host using the scheme if available.
Format the host using the scheme if available.
protected function formatHost(array $options): string
| type | name | summary |
|---|---|---|
| array | $options |
|
| type | summary |
|---|---|
| string | |
[C] PredisConnector
| type | summary |
|---|---|
| Connector | |
[m] connect Create a new clustered Predis connection.
Create a new clustered Predis connection.
public function connect( array $config, array $options ): Illuminate\Redis\Connections\PredisConnection
| type | name | summary |
|---|---|---|
| array | $config |
|
| array | $options |
|
| type | summary |
|---|---|
| PredisConnection | |
| kind | source | summary |
|---|---|---|
| implement | Connector::connect() | |
[m] connectToCluster Create a new clustered Predis connection.
Create a new clustered Predis connection.
public function connectToCluster( array $config, array $clusterOptions, array $options ): Illuminate\Redis\Connections\PredisClusterConnection
| type | name | summary |
|---|---|---|
| array | $config |
|
| array | $clusterOptions |
|
| array | $options |
|
| type | summary |
|---|---|
| PredisClusterConnection | |
| kind | source | summary |
|---|---|---|
| implement | Connector::connectToCluster() | |
[N] Illuminate\Redis\Events\
[C] CommandExecuted
[p] $command The Redis command that was executed.
The Redis command that was executed.
public string $command = null
[p] $parameters The array of command parameters.
The array of command parameters.
public array $parameters = null
[p] $time The number of milliseconds it took to execute the command.
The number of milliseconds it took to execute the command.
public float $time = null
[p] $connection The Redis connection instance.
The Redis connection instance.
public Illuminate\Redis\Connections\Connection $connection = null
[p] $connectionName The Redis connection name.
The Redis connection name.
public string $connectionName = null
[m] __construct Create a new event instance.
Create a new event instance.
public function __construct( string $command, array $parameters, float|null $time, Illuminate\Redis\Connections\Connection $connection ): void
| type | name | summary |
|---|---|---|
| string | $command |
|
| array | $parameters |
|
| float|null | $time |
|
| Connection | $connection |
|
| type | summary |
|---|---|
| void | |
[N] Illuminate\Redis\Limiters\
[C] ConcurrencyLimiter
[p] $redis The Redis factory implementation.
The Redis factory implementation.
protected Illuminate\Redis\Connections\Connection $redis = null
[p] $name The name of the limiter.
The name of the limiter.
protected string $name = null
[p] $maxLocks The allowed number of concurrent tasks.
The allowed number of concurrent tasks.
protected int $maxLocks = null
[p] $releaseAfter The number of seconds a slot should be maintained.
The number of seconds a slot should be maintained.
protected int $releaseAfter = null
[m] __construct Create a new concurrency limiter instance.
Create a new concurrency limiter instance.
public function __construct( Illuminate\Redis\Connections\Connection $redis, string $name, int $maxLocks, int $releaseAfter ): void
| type | name | summary |
|---|---|---|
| Connection | $redis |
|
| string | $name |
|
| int | $maxLocks |
|
| int | $releaseAfter |
|
| type | summary |
|---|---|
| void | |
[m] block Attempt to acquire the lock for the given number of seconds.
Attempt to acquire the lock for the given number of seconds.
public function block( int $timeout, callable|null $callback = null ): bool
| type | name | summary |
|---|---|---|
| int | $timeout |
|
| callable|null | $callback = null |
|
| type | summary |
|---|---|
| bool | |
| type | summary |
|---|---|
| LimiterTimeoutException | |
| Throwable | |
[m] acquire Attempt to acquire the lock.
Attempt to acquire the lock.
protected function acquire(string $id): mixed
| type | name | summary |
|---|---|---|
| string | $id |
A unique identifier for this lock |
| type | summary |
|---|---|
| mixed | |
[m] lockScript Get the Lua script for acquiring a lock.
Get the Lua script for acquiring a lock.
protected function lockScript(): string
KEYS - The keys that represent available slots ARGV[1] - The limiter name ARGV[2] - The number of seconds the slot should be reserved ARGV[3] - The unique identifier for this lock
| type | summary |
|---|---|
| string | |
[m] release Release the lock.
Release the lock.
protected function release( string $key, string $id ): void
| type | name | summary |
|---|---|---|
| string | $key |
|
| string | $id |
|
| type | summary |
|---|---|
| void | |
[m] releaseScript Get the Lua script to atomically release a lock.
Get the Lua script to atomically release a lock.
protected function releaseScript(): string
KEYS[1] - The name of the lock ARGV[1] - The unique identifier for this lock
| type | summary |
|---|---|
| string | |
[C] ConcurrencyLimiterBuilder
| type | summary |
|---|---|
| InteractsWithTime | |
[p] $connection The Redis connection.
The Redis connection.
public Illuminate\Redis\Connections\Connection $connection = null
[p] $name The name of the lock.
The name of the lock.
public string $name = null
[p] $maxLocks The maximum number of entities that can hold the lock at the same time.
The maximum number of entities that can hold the lock at the same time.
public int $maxLocks = null
[p] $releaseAfter The number of seconds to maintain the lock until it is automatically released.
The number of seconds to maintain the lock until it is automatically released.
public int $releaseAfter = 60
[p] $timeout The amount of time to block until a lock is available.
The amount of time to block until a lock is available.
public int $timeout = 3
[m] __construct Create a new builder instance.
Create a new builder instance.
public function __construct( Illuminate\Redis\Connections\Connection $connection, string $name ): void
| type | name | summary |
|---|---|---|
| Connection | $connection |
|
| string | $name |
|
| type | summary |
|---|---|
| void | |
[m] limit Set the maximum number of locks that can be obtained per time window.
Set the maximum number of locks that can be obtained per time window.
public function limit(int $maxLocks): Illuminate\Redis\Limiters\ConcurrencyLimiterBuilder
| type | name | summary |
|---|---|---|
| int | $maxLocks |
|
| type | summary |
|---|---|
| ConcurrencyLimiterBuilder | |
[m] releaseAfter Set the number of seconds until the lock will be released.
Set the number of seconds until the lock will be released.
public function releaseAfter(int $releaseAfter): Illuminate\Redis\Limiters\ConcurrencyLimiterBuilder
| type | name | summary |
|---|---|---|
| int | $releaseAfter |
|
| type | summary |
|---|---|
| ConcurrencyLimiterBuilder | |
[m] block Set the amount of time to block until a lock is available.
Set the amount of time to block until a lock is available.
public function block(int $timeout): Illuminate\Redis\Limiters\ConcurrencyLimiterBuilder
| type | name | summary |
|---|---|---|
| int | $timeout |
|
| type | summary |
|---|---|
| ConcurrencyLimiterBuilder | |
[m] then Execute the given callback if a lock is obtained, otherwise call the failure callback.
Execute the given callback if a lock is obtained, otherwise call the failure callback.
public function then( callable $callback, ?callable|callable|null $failure = null ): mixed
| type | name | summary |
|---|---|---|
| callable | $callback |
|
| ?callable|callable|null | $failure = null |
|
| type | summary |
|---|---|
| mixed | |
| type | summary |
|---|---|
| LimiterTimeoutException | |
[m] secondsUntil Get the number of seconds until the given DateTime.
Get the number of seconds until the given DateTime.
protected function secondsUntil(\DateTimeInterface|\DateInterval|int $delay): int
| type | name | summary |
|---|---|---|
| DateTimeInterface|DateInterval|int | $delay |
|
| type | summary |
|---|---|
| int | |
| kind | source | summary |
|---|---|---|
| instead | InteractsWithTime::secondsUntil() | |
[m] availableAt Get the "available at" UNIX timestamp.
Get the "available at" UNIX timestamp.
protected function availableAt(\DateTimeInterface|\DateInterval|int $delay = 0): int
| type | name | summary |
|---|---|---|
| DateTimeInterface|DateInterval|int | $delay = 0 |
|
| type | summary |
|---|---|
| int | |
| kind | source | summary |
|---|---|---|
| instead | InteractsWithTime::availableAt() | |
[m] parseDateInterval If the given value is an interval, convert it to a DateTime instance.
If the given value is an interval, convert it to a DateTime instance.
protected function parseDateInterval(\DateTimeInterface|\DateInterval|int $delay): \DateTimeInterface|int
| type | name | summary |
|---|---|---|
| DateTimeInterface|DateInterval|int | $delay |
|
| type | summary |
|---|---|
| DateTimeInterface|int | |
| kind | source | summary |
|---|---|---|
| instead | InteractsWithTime::parseDateInterval() | |
[m] currentTime Get the current system time as a UNIX timestamp.
Get the current system time as a UNIX timestamp.
protected function currentTime(): int
| type | summary |
|---|---|
| int | |
| kind | source | summary |
|---|---|---|
| instead | InteractsWithTime::currentTime() | |
[C] DurationLimiter
[p] $redis The Redis factory implementation.
The Redis factory implementation.
private Illuminate\Redis\Connections\Connection $redis = null
[p] $name The unique name of the lock.
The unique name of the lock.
private string $name = null
[p] $maxLocks The allowed number of concurrent tasks.
The allowed number of concurrent tasks.
private int $maxLocks = null
[p] $decay The number of seconds a slot should be maintained.
The number of seconds a slot should be maintained.
private int $decay = null
[p] $decaysAt The timestamp of the end of the current duration.
The timestamp of the end of the current duration.
public int $decaysAt = null
[p] $remaining The number of remaining slots.
The number of remaining slots.
public int $remaining = null
[m] __construct Create a new duration limiter instance.
Create a new duration limiter instance.
public function __construct( Illuminate\Redis\Connections\Connection $redis, string $name, int $maxLocks, int $decay ): void
| type | name | summary |
|---|---|---|
| Connection | $redis |
|
| string | $name |
|
| int | $maxLocks |
|
| int | $decay |
|
| type | summary |
|---|---|
| void | |
[m] block Attempt to acquire the lock for the given number of seconds.
Attempt to acquire the lock for the given number of seconds.
public function block( int $timeout, callable|null $callback = null ): mixed
| type | name | summary |
|---|---|---|
| int | $timeout |
|
| callable|null | $callback = null |
|
| type | summary |
|---|---|
| mixed | |
| type | summary |
|---|---|
| LimiterTimeoutException | |
[m] acquire Attempt to acquire the lock.
Attempt to acquire the lock.
public function acquire(): bool
| type | summary |
|---|---|
| bool | |
[m] tooManyAttempts Determine if the key has been "accessed" too many times.
Determine if the key has been "accessed" too many times.
public function tooManyAttempts(): bool
| type | summary |
|---|---|
| bool | |
[m] clear Clear the limiter.
Clear the limiter.
public function clear(): void
| type | summary |
|---|---|
| void | |
[m] luaScript Get the Lua script for acquiring a lock.
Get the Lua script for acquiring a lock.
protected function luaScript(): string
KEYS[1] - The limiter name ARGV[1] - Current time in microseconds ARGV[2] - Current time in seconds ARGV[3] - Duration of the bucket ARGV[4] - Allowed number of tasks
| type | summary |
|---|---|
| string | |
[m] tooManyAttemptsLuaScript Get the Lua script to determine if the key has been "accessed" too many times.
Get the Lua script to determine if the key has been "accessed" too many times.
protected function tooManyAttemptsLuaScript(): string
KEYS[1] - The limiter name ARGV[1] - Current time in microseconds ARGV[2] - Current time in seconds ARGV[3] - Duration of the bucket ARGV[4] - Allowed number of tasks
| type | summary |
|---|---|
| string | |
[C] DurationLimiterBuilder
| type | summary |
|---|---|
| InteractsWithTime | |
[p] $connection The Redis connection.
The Redis connection.
public Illuminate\Redis\Connections\Connection $connection = null
[p] $name The name of the lock.
The name of the lock.
public string $name = null
[p] $maxLocks The maximum number of locks that can be obtained per time window.
The maximum number of locks that can be obtained per time window.
public int $maxLocks = null
[p] $decay The amount of time the lock window is maintained.
The amount of time the lock window is maintained.
public int $decay = null
[p] $timeout The amount of time to block until a lock is available.
The amount of time to block until a lock is available.
public int $timeout = 3
[m] __construct Create a new builder instance.
Create a new builder instance.
public function __construct( Illuminate\Redis\Connections\Connection $connection, string $name ): void
| type | name | summary |
|---|---|---|
| Connection | $connection |
|
| string | $name |
|
| type | summary |
|---|---|
| void | |
[m] allow Set the maximum number of locks that can be obtained per time window.
Set the maximum number of locks that can be obtained per time window.
public function allow(int $maxLocks): Illuminate\Redis\Limiters\DurationLimiterBuilder
| type | name | summary |
|---|---|---|
| int | $maxLocks |
|
| type | summary |
|---|---|
| DurationLimiterBuilder | |
[m] every Set the amount of time the lock window is maintained.
Set the amount of time the lock window is maintained.
public function every(\DateTimeInterface|\DateInterval|int $decay): Illuminate\Redis\Limiters\DurationLimiterBuilder
| type | name | summary |
|---|---|---|
| DateTimeInterface|DateInterval|int | $decay |
|
| type | summary |
|---|---|
| DurationLimiterBuilder | |
[m] block Set the amount of time to block until a lock is available.
Set the amount of time to block until a lock is available.
public function block(int $timeout): Illuminate\Redis\Limiters\DurationLimiterBuilder
| type | name | summary |
|---|---|---|
| int | $timeout |
|
| type | summary |
|---|---|
| DurationLimiterBuilder | |
[m] then Execute the given callback if a lock is obtained, otherwise call the failure callback.
Execute the given callback if a lock is obtained, otherwise call the failure callback.
public function then( callable $callback, ?callable|callable|null $failure = null ): mixed
| type | name | summary |
|---|---|---|
| callable | $callback |
|
| ?callable|callable|null | $failure = null |
|
| type | summary |
|---|---|
| mixed | |
| type | summary |
|---|---|
| LimiterTimeoutException | |
[m] secondsUntil Get the number of seconds until the given DateTime.
Get the number of seconds until the given DateTime.
protected function secondsUntil(\DateTimeInterface|\DateInterval|int $delay): int
| type | name | summary |
|---|---|---|
| DateTimeInterface|DateInterval|int | $delay |
|
| type | summary |
|---|---|
| int | |
| kind | source | summary |
|---|---|---|
| instead | InteractsWithTime::secondsUntil() | |
[m] availableAt Get the "available at" UNIX timestamp.
Get the "available at" UNIX timestamp.
protected function availableAt(\DateTimeInterface|\DateInterval|int $delay = 0): int
| type | name | summary |
|---|---|---|
| DateTimeInterface|DateInterval|int | $delay = 0 |
|
| type | summary |
|---|---|
| int | |
| kind | source | summary |
|---|---|---|
| instead | InteractsWithTime::availableAt() | |
[m] parseDateInterval If the given value is an interval, convert it to a DateTime instance.
If the given value is an interval, convert it to a DateTime instance.
protected function parseDateInterval(\DateTimeInterface|\DateInterval|int $delay): \DateTimeInterface|int
| type | name | summary |
|---|---|---|
| DateTimeInterface|DateInterval|int | $delay |
|
| type | summary |
|---|---|
| DateTimeInterface|int | |
| kind | source | summary |
|---|---|---|
| instead | InteractsWithTime::parseDateInterval() | |
[m] currentTime Get the current system time as a UNIX timestamp.
Get the current system time as a UNIX timestamp.
protected function currentTime(): int
| type | summary |
|---|---|
| int | |
| kind | source | summary |
|---|---|---|
| instead | InteractsWithTime::currentTime() | |