PHPackages                             amirhwsin/php-ratelimit - 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. amirhwsin/php-ratelimit

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

amirhwsin/php-ratelimit
=======================

A lightway php ratelimit package.

v1.0.1(5y ago)018PHPPHP &gt;=5.3.0

Since Jun 16Pushed 5y ago1 watchersCompare

[ Source](https://github.com/amireshoon/RateLimitMicroFrameWork)[ Packagist](https://packagist.org/packages/amirhwsin/php-ratelimit)[ RSS](/packages/amirhwsin-php-ratelimit/feed)WikiDiscussions master Synced 5d ago

READMEChangelog (4)DependenciesVersions (4)Used By (0)

RateLimitMicroFrameWork
=======================

[](#ratelimitmicroframework)

A lightway php rate limit microframework
This package uses users IP to specify users from each other.

How to use?
===========

[](#how-to-use)

Add package to your project with composer like this:

```
composer require amirhwsin/php-ratelimit
```

Then run composer autoload:

```
require_once __DIR__ . '/vendor/autoload.php';
```

Then add this code where you want to ratelimit:

```
use RateLimit\Limiter;

$tra = new RateLimit\Limiter();

// How many requests do you want to handle?
$tra->requests = 30;

// In what range? Enter in minutes: 1Min
$tra->inRange = 1;

// Returns true when user good to go and false if user limited
if(!$tra->track()) {
    echo 'rate limited';
    exit; // in case of you want to break users connection with server.
}
```

Storage
=======

[](#storage)

This microframework uses json storage similiar to [jStorage](https://github.com/amireshoon/jStorage).

### Set storage path

[](#set-storage-path)

```
$tra->path = '../storage/rate.limit';
```

### Get storage path/content

[](#get-storage-pathcontent)

```
$storagePath = $tra->path;
fopen($storagePath);
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

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 ~0 days

Total

3

Last Release

2160d ago

Major Versions

v0.1 → v1.0.12020-06-16

### Community

Maintainers

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

---

Top Contributors

[![amireshoon](https://avatars.githubusercontent.com/u/36164960?v=4)](https://github.com/amireshoon "amireshoon (8 commits)")

### Embed Badge

![Health badge](/badges/amirhwsin-php-ratelimit/health.svg)

```
[![Health](https://phpackages.com/badges/amirhwsin-php-ratelimit/health.svg)](https://phpackages.com/packages/amirhwsin-php-ratelimit)
```

###  Alternatives

[allysonsilva/laravel-multienv

This package allows you to use multiple .envs in multitenant environment

537.2k](/packages/allysonsilva-laravel-multienv)

PHPackages © 2026

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