|
MediaWiki REL1_39
|
Provides rate limiting for a set of actions based on several counter buckets. More...
Public Member Functions | |
| __construct (ServiceOptions $options, WRStatsFactory $wrstatsFactory, ?CentralIdLookup $centralIdLookup, UserFactory $userFactory, UserGroupManager $userGroupManager, HookContainer $hookContainer) | |
| isExempt (RateLimitSubject $subject) | |
| Is this user exempt from rate limiting? | |
| limit (RateLimitSubject $subject, string $action, int $incrBy=1) | |
| Implements simple rate limits: enforce maximum actions per time period to put a brake on flooding. | |
Public Attributes | |
| const | CONSTRUCTOR_OPTIONS |
Provides rate limiting for a set of actions based on several counter buckets.
Definition at line 42 of file RateLimiter.php.
| MediaWiki\Permissions\RateLimiter::__construct | ( | ServiceOptions | $options, |
| WRStatsFactory | $wrstatsFactory, | ||
| ?CentralIdLookup | $centralIdLookup, | ||
| UserFactory | $userFactory, | ||
| UserGroupManager | $userGroupManager, | ||
| HookContainer | $hookContainer ) |
| ServiceOptions | $options | |
| WRStatsFactory | $wrstatsFactory | |
| CentralIdLookup | null | $centralIdLookup | |
| UserFactory | $userFactory | |
| UserGroupManager | $userGroupManager | |
| HookContainer | $hookContainer |
Definition at line 84 of file RateLimiter.php.
References MediaWiki\Config\ServiceOptions\assertRequiredOptions(), and MediaWiki\MainConfigNames\RateLimits.
| MediaWiki\Permissions\RateLimiter::isExempt | ( | RateLimitSubject | $subject | ) |
Is this user exempt from rate limiting?
| RateLimitSubject | $subject | The subject of the rate limit, representing the client performing the action. |
Definition at line 113 of file RateLimiter.php.
References MediaWiki\Permissions\RateLimitSubject\getIP(), MediaWiki\Permissions\RateLimitSubject\is(), and MediaWiki\MainConfigNames\RateLimitsExcludedIPs.
Referenced by MediaWiki\Permissions\RateLimiter\limit().
| MediaWiki\Permissions\RateLimiter::limit | ( | RateLimitSubject | $subject, |
| string | $action, | ||
| int | $incrBy = 1 ) |
Implements simple rate limits: enforce maximum actions per time period to put a brake on flooding.
| RateLimitSubject | $subject | The subject of the rate limit, representing the client performing the action. |
| string | $action | Action to enforce |
| int | $incrBy | Positive amount to increment counter by, 1 per default. Use 0 to check the limit without bumping the counter. |
Definition at line 140 of file RateLimiter.php.
References $type, CentralIdLookup\AUDIENCE_RAW, MediaWiki\Permissions\RateLimitSubject\getIP(), MediaWiki\Permissions\RateLimitSubject\getUser(), MediaWiki\Permissions\RateLimitSubject\is(), and MediaWiki\Permissions\RateLimiter\isExempt().
| const MediaWiki\Permissions\RateLimiter::CONSTRUCTOR_OPTIONS |
Definition at line 71 of file RateLimiter.php.