PHPackages                             soxft/rate-limit - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Caching](/categories/caching)
4. /
5. soxft/rate-limit

ActiveLibrary[Caching](/categories/caching)

soxft/rate-limit
================

General purpose rate limiter implementation.

1.1.5(1y ago)121MITPHPPHP ^7.4 || ^8.0

Since Feb 19Pushed 1y ago1 watchersCompare

[ Source](https://github.com/soxft/rate-limit)[ Packagist](https://packagist.org/packages/soxft/rate-limit)[ RSS](/packages/soxft-rate-limit/feed)WikiDiscussions main Synced today

READMEChangelog (6)DependenciesVersions (8)Used By (0)

Rate Limit
==========

[](#rate-limit)

> 基于Redis 的 PHP 速率限制

Installation
------------

[](#installation)

```
composer require soxft/rate-limit
```

Usage
-----

[](#usage)

**Terminating rate limiter**

```
use RateLimit\Rate;
use RateLimit\RateLimiter;
use RateLimit\Exception\LimitExceededException;

$rateLimiter = new RateLimiter(Rate::perMinute(100), new \Redis());

$apiKey = 'abc123'; // 用户标识

try {
    $rateLimiter->limit($apiKey);

    //on success
} catch (LimitExceededException $exception) {
   //on limit exceeded
}
```

**Silent rate limiter**

```
use RateLimit\Rate;
use RateLimit\RateLimiter;

$rateLimiter = new RateLimiter(Rate::perMinute(100), new \Redis());

$ipAddress = '192.168.1.2';
$status = $rateLimiter->limitSilently($ipAddress);

echo $status->left(); //99
```

License
-------

[](#license)

Released under MIT License - see the [License File](LICENSE) for details.

Secondary development based on [nikolaposa/rate-limie](https://github.com/nikolaposa/rate-limit)

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~176 days

Recently: every ~41 days

Total

6

Last Release

714d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/42080379?v=4)[xcsoft](/maintainers/soxft)[@soxft](https://github.com/soxft)

---

Top Contributors

[![soxft](https://avatars.githubusercontent.com/u/42080379?v=4)](https://github.com/soxft "soxft (12 commits)")

---

Tags

redisrate limit

### Embed Badge

![Health badge](/badges/soxft-rate-limit/health.svg)

```
[![Health](https://phpackages.com/badges/soxft-rate-limit/health.svg)](https://phpackages.com/packages/soxft-rate-limit)
```

###  Alternatives

[predis/predis

A flexible and feature-complete Redis/Valkey client for PHP.

7.8k325.4M2.8k](/packages/predis-predis)[snc/redis-bundle

A Redis bundle for Symfony

1.0k40.9M75](/packages/snc-redis-bundle)[nikolaposa/rate-limit

General purpose rate limiter implementation.

2741.7M3](/packages/nikolaposa-rate-limit)[clue/redis-protocol

A streaming Redis protocol (RESP) parser and serializer written in pure PHP.

5216.6M14](/packages/clue-redis-protocol)[rtcamp/nginx-helper

Cleans nginx's fastcgi/proxy cache or redis-cache whenever a post is edited/published. Also provides cloudflare edge cache purging with Cache-Tags.

23617.1k1](/packages/rtcamp-nginx-helper)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
