PHPackages                             cyzonetech/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. cyzonetech/rate-limit

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

cyzonetech/rate-limit
=====================

Rate Limiting Library With Token Bucket Algorithm

1.3.1(7y ago)0314MITPHPPHP &gt;=5.5

Since May 16Pushed 7y agoCompare

[ Source](https://github.com/cyzonetech/RateLimit)[ Packagist](https://packagist.org/packages/cyzonetech/rate-limit)[ RSS](/packages/cyzonetech-rate-limit/feed)WikiDiscussions master Synced yesterday

READMEChangelog (3)Dependencies (1)Versions (7)Used By (0)

[![Build Status](https://camo.githubusercontent.com/3758d6ab27d1a57aa10aaf61f78cb48475a320a62fa76bfb76cfd9721d35ddcf/68747470733a2f2f7472617669732d63692e6f72672f746f75686f6e6f6f622f526174654c696d69742e737667)](https://travis-ci.org/touhonoob/RateLimit/)[![Code Climate](https://camo.githubusercontent.com/b58c19fad3c542a339b341a2f76c1c1d3a257e3ff00bb185a4d2ec62943e6e51/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f746f75686f6e6f6f622f526174654c696d69742f6261646765732f6770612e737667)](https://codeclimate.com/github/touhonoob/RateLimit)

RateLimit
=========

[](#ratelimit)

PHP Rate Limiting Library With [Token Bucket Algorithm](http://en.wikipedia.org/wiki/Token_bucket)

Storage Adapters
================

[](#storage-adapters)

- [APCu](https://pecl.php.net/package/APCu)
- [Redis](https://pecl.php.net/package/redis)

Example
=======

[](#example)

```
require 'vendor/autoload.php';

use \Touhonoob\RateLimit\RateLimit;
use \Touhonoob\RateLimit\Adapter\APC as RateLimitAdapterAPC;
use \Touhonoob\RateLimit\Adapter\Redis as RateLimitAdapterRedis;

$adapter = new RateLimitAdapterAPC(); // Use APC as Storage
// $adapter = new RateLimitAdapterRedis(); // Use Redis as Storage
$rateLimit = new RateLimit("myratelimit", 100, 3600, $adapter); // 100 Requests / Hour

$id = $_SERVER['REMOTE_ADDR']; // Use client IP as identity
if ($rateLimit->check($id) > 0) {
  echo "passed";
} else {
  echo "rate limit exceeded";
}
```

Installing via Composer
=======================

[](#installing-via-composer)

```
curl -sS https://getcomposer.org/installer | php
composer.phar require touhonoob/rate-limit
```

References
==========

[](#references)

-
- [http://en.wikipedia.org/wiki/Token\_bucket](http://en.wikipedia.org/wiki/Token_bucket)

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 83.3% 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 ~416 days

Total

4

Last Release

2766d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3ef3569ae46017080f8b5991b777151e843af273ee124f0cd65f6cffa6cb0cfd?d=identicon)[cyzonetech](/maintainers/cyzonetech)

---

Top Contributors

[![touhonoob](https://avatars.githubusercontent.com/u/1391892?v=4)](https://github.com/touhonoob "touhonoob (20 commits)")[![cyzonetech](https://avatars.githubusercontent.com/u/30819954?v=4)](https://github.com/cyzonetech "cyzonetech (2 commits)")[![bitbybit](https://avatars.githubusercontent.com/u/1628191?v=4)](https://github.com/bitbybit "bitbybit (1 commits)")[![Icewild](https://avatars.githubusercontent.com/u/8243173?v=4)](https://github.com/Icewild "Icewild (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[tomk79/php-excel2html

Convert Excel(\*.xlsx) to HTML table. with PHPExcel.

1513.7k3](/packages/tomk79-php-excel2html)

PHPackages © 2026

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