PHPackages                             hao/algorithm - 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. hao/algorithm

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

hao/algorithm
=============

api接口限流

1.0.2(5y ago)055MITPHPPHP &gt;=5.3.3

Since Jun 30Pushed 5y ago1 watchersCompare

[ Source](https://github.com/JZhao1020/algorithm)[ Packagist](https://packagist.org/packages/hao/algorithm)[ Docs](https://github.com/JZhao1020/algorithm)[ RSS](/packages/hao-algorithm/feed)WikiDiscussions master Synced today

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

algorithm
=========

[](#algorithm)

接口限流

开源地址
----

[](#开源地址)

\##1.安装

```
composer require hao/algorithm

```

\##2.实例化

```
$config = [
	'limit' => 10, // 请求限制量
	'interval' => 2000, // 请求单位时间 毫秒
];
$Counter = new \limiting\Algorithm($config);

```

\##2.1 计数器限流

```
$url = 'limiting:counter:'. url();
$Counter->gateway('Counter')->slidingGrant($url);

```

\##2.2 令牌限流

```
$url = 'limiting:token_bucket:'. url();
$Counter->gateway('TokenBucket')->slidingGrant($url);

```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

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

Total

3

Last Release

2061d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/150cac62db0286325a8ed8971fb217d79b30f89e3087efd17a0d47863b3a7ab0?d=identicon)[JZhao1020](/maintainers/JZhao1020)

---

Top Contributors

[![JZhao1020](https://avatars.githubusercontent.com/u/22906648?v=4)](https://github.com/JZhao1020 "JZhao1020 (3 commits)")

---

Tags

Algorithm

### Embed Badge

![Health badge](/badges/hao-algorithm/health.svg)

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

###  Alternatives

[rubix/ml

A high-level machine learning and deep learning library for the PHP language.

2.2k1.4M28](/packages/rubix-ml)[donatello-za/rake-php-plus

Yet another PHP implementation of the Rapid Automatic Keyword Extraction algorithm (RAKE).

271865.1k10](/packages/donatello-za-rake-php-plus)[tga/simhash-php

SimHash similarities algorithm implementation for PHP 5.3

15243.5k1](/packages/tga-simhash-php)[fisharebest/algorithm

Implementation of standard algorithms in PHP.

7192.7k1](/packages/fisharebest-algorithm)[edgaras/strsim

Collection of string similarity and distance algorithms in PHP including Levenshtein, Damerau-Levenshtein, Jaro-Winkler, and more

2423.0k](/packages/edgaras-strsim)[uestla/simplex-calculator

Simple tool for linear programming problems solving

427.6k](/packages/uestla-simplex-calculator)

PHPackages © 2026

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