VuFind API Documentation

RateLimiterManagerFactory
in package
implements FactoryInterface

Rate limiter manager factory.

Tags
category

VuFind

author

Ere Maijala ere.maijala@helsinki.fi

license

http://opensource.org/licenses/gpl-2.0.php GNU General Public License

link

Wiki

Interfaces, Classes, Traits and Enums

FactoryInterface

Table of Contents

$serviceLocator  : ContainerInterface
Service locator
__invoke()  : object
Create an object
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

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
throws
ServiceNotFoundException

if unable to resolve the service.

throws
ServiceNotCreatedException

if an exception is raised when creating a service.

throws
ContainerExceptionInterface|Throwable

if any other error occurs

Return values
object

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

Return values
LimiterInterface

Search results