RateLimiterManagerFactory
in package
implements
FactoryInterface
Uses
GetServiceTrait
Rate limiter manager factory.
Tags
Interfaces, Classes, Traits and Enums
- FactoryInterface
Table of Contents
- $serviceLocator : ContainerInterface
- Service manager
- __invoke() : object
- Create an object
- getService() : T
- Retrieve a service
- createCache() : StorageInterface|null
- Create cache for the rate limiter
- createRedisCache() : StorageInterface|null
- Create Redis cache for the rate limiter
- getRateLimiter() : LimiterInterface
- Get rate limiter
Properties
$serviceLocator
Service manager
protected
ContainerInterface
$serviceLocator
Methods
__invoke()
Create an object
public
__invoke(ContainerInterface $container, string $requestedName[, null|array<string|int, mixed> $options = null ]) : object
Parameters
- $container : ContainerInterface
-
Service manager
- $requestedName : string
-
Service being created
- $options : null|array<string|int, mixed> = null
-
Extra options (optional)
Tags
Return values
object —getService()
Retrieve a service
public
getService(class-string<\VuFind\Service\T> $name) : T
Parameters
- $name : class-string<\VuFind\Service\T>
-
Name of service to retrieve
Tags
Return values
T —createCache()
Create cache for the rate limiter
protected
createCache(array<string|int, mixed> $config) : StorageInterface|null
Parameters
- $config : array<string|int, mixed>
-
Rate limiter configuration
Return values
StorageInterface|null —createRedisCache()
Create Redis cache for the rate limiter
protected
createRedisCache(array<string|int, mixed> $storageConfig) : StorageInterface|null
Parameters
- $storageConfig : array<string|int, mixed>
-
Storage configuration
Return values
StorageInterface|null —getRateLimiter()
Get rate limiter
protected
getRateLimiter(array<string|int, mixed> $config, string $policyId, string $clientIp, string|null $userId) : LimiterInterface
Parameters
- $config : array<string|int, mixed>
-
Rate limiter configuration
- $policyId : string
-
Policy ID
- $clientIp : string
-
Client's IP address
- $userId : string|null
-
User ID or null if not logged in