PHPackages                             imj/frequency - 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. imj/frequency

ActiveLibrary[Caching](/categories/caching)

imj/frequency
=============

A simple frequency control system based on redis

v1.0.3(9y ago)024MITPHPPHP &gt;=5.3.0

Since Jun 20Pushed 9y agoCompare

[ Source](https://github.com/itsmikej/Frequency)[ Packagist](https://packagist.org/packages/imj/frequency)[ RSS](/packages/imj-frequency/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (1)Versions (5)Used By (0)

A simple frequency control system
=================================

[](#a-simple-frequency-control-system)

[![Latest Stable Version](https://camo.githubusercontent.com/afbdd1621ea5d0dce1cf5e37d7cef4a809856ff187388a6b6f5b78b809cf4f3c/68747470733a2f2f706f7365722e707567782e6f72672f696d6a2f6672657175656e63792f762f737461626c65)](https://packagist.org/packages/imj/frequency)[![Total Downloads](https://camo.githubusercontent.com/536880262d566bc7453d5e97d1725dfd71fdf03547b5e92a6d54e4cea5d74c75/68747470733a2f2f706f7365722e707567782e6f72672f696d6a2f6672657175656e63792f646f776e6c6f616473)](https://packagist.org/packages/imj/frequency)[![License](https://camo.githubusercontent.com/6aef94d839ad6ffd22507ad2e40b84ba69649e4bd332f3f80163b7494b38f5d4/68747470733a2f2f706f7365722e707567782e6f72672f696d6a2f6672657175656e63792f6c6963656e7365)](https://packagist.org/packages/imj/frequency)

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

[](#installation)

```
composer require imj/frequency
```

Basic Usage
-----------

[](#basic-usage)

```
use Imj\Frequency;

$config = [
  'time_unit' => 5,
  'recycle'   => 120,
  'default'   => 0,
  'rules'	=> [
    10 => [
      10 => 1,  // 10分钟操作10次及以上返回1
      20 => 2,
      30 => 3,
      40 => 4,
    ],
    20 => [
      80 => 5
    ]
  ]
];

$redis = getRedis();
$freq = new Frequency($redis, $config);

$ip = getIp();
$ret= $freq->check($ip);
$min = 10;
$times = $freq->checkTimes($ip, $min);
```

License
-------

[](#license)

licensed under the MIT License - see the `LICENSE` file for details

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity61

Established project with proven stability

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

Total

4

Last Release

3453d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f2f9f468a9f96136e78bf56c403a526dcc06e7eed79e627683f2ca73b1142ac8?d=identicon)[itsmikej](/maintainers/itsmikej)

---

Top Contributors

[![yanglgtm](https://avatars.githubusercontent.com/u/2657476?v=4)](https://github.com/yanglgtm "yanglgtm (9 commits)")

---

Tags

frequency

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/imj-frequency/health.svg)

```
[![Health](https://phpackages.com/badges/imj-frequency/health.svg)](https://phpackages.com/packages/imj-frequency)
```

PHPackages © 2026

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