PHPackages                             nw/request-limit-bundle - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. nw/request-limit-bundle

ActiveSymfony-bundle[Authentication &amp; Authorization](/categories/authentication)

nw/request-limit-bundle
=======================

This bundle provides a light way to restrict user access to some action for a specific time frame

v1.0(5y ago)271MITTwigPHP ^7CI failing

Since Dec 16Pushed 5y agoCompare

[ Source](https://github.com/nowiko/RequestLimitBundle)[ Packagist](https://packagist.org/packages/nw/request-limit-bundle)[ Docs](https://github.com/NovikovViktor/RequestLimitBundle)[ RSS](/packages/nw-request-limit-bundle/feed)WikiDiscussions master Synced 1w ago

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

[![SensioLabsInsight](https://camo.githubusercontent.com/c037c5e29a054d3fa063bd7705429291f8f5a8e75ddffacea018244d89f55d52/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f66356136373636332d633032382d346534662d393063392d3163646638313532323533652f6d696e692e706e67)](https://insight.sensiolabs.com/projects/f5a67663-c028-4e4f-90c9-1cdf8152253e) [![Build Status](https://camo.githubusercontent.com/6051ec2a3218d32ba41423e0610550df2a1b995532fcdee78df3e2048ff05dc1/68747470733a2f2f7472617669732d63692e6f72672f6e6f77696b6f2f526571756573744c696d697442756e646c652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/nowiko/RequestLimitBundle) [![Scrutinizer Code Quality](https://camo.githubusercontent.com/85adc8a307a80032b0b77f3c90503ad3d7cde02cbbe05d9b5b61b62acd524dca/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4e6f76696b6f7656696b746f722f526571756573744c696d697442756e646c652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/NovikovViktor/RequestLimitBundle/?branch=master) [![Maintainability](https://camo.githubusercontent.com/2f203dc28e81a727e37af63312a7fa5119d650b4213bceac122fb85b5bc7cbc9/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f30346436336439663533366530373730323762302f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/NovikovViktor/RequestLimitBundle/maintainability)

RequestLimitBundle
==================

[](#requestlimitbundle)

This bundle is a simple solution to restrict user access to some controller for a specified timeline.

This functionality could be used for different cases when you need to:

- prevent flood - pushing users of irrelevant data;
- prevent a user from accessing the certain endpoint very often, etc.

Installation
============

[](#installation)

1. Install package via:

```
    composer require nw/request-limit-bundle
```

2. Register bundle :

In `app/AppKernel.php` prior to Symfony version `4.0`:

```
public function registerBundles()
{
    $bundles = [
        // ... ,
        new NW\RequestLimitBundle\NWRequestLimitBundle()
    ];

    // ...
    return $bundles;
}
```

In `config/bundles.php` when Symfony version is `4.0` and higher

```
return [
    //... other bundles
    NW\RequestLimitBundle\NWRequestLimitBundle::class => ['all' => true]
];
```

3. Configure the bundle according to the provider you would like to use. Out of the box, we provide the Memcached and MySQL providers. To see configuration options, see the docs below.

- [Memcached provider configuration](https://github.com/NovikovViktor/RequestLimitBundle/blob/master/Resources/docs/memcached.md)
- [MySQL provider configuration](https://github.com/NovikovViktor/RequestLimitBundle/blob/master/Resources/docs/mysql.md)

If you want to use other storage, you can implement your provider.

4. Specify `restriction_time` in seconds:

```
nw_request_limit:
    #... options for provider configuration
    restriction_time: 5  # 5 seconds
```

Usage
=====

[](#usage)

In your action, add the following line to restrict access by some specific application user artifact (e.g., user id, user IP, etc.):

```
$artifact = 'e.g. get user id or IP here';
$this->get('nw.request_limit.restrictor')->blockBy($artifact);
```

These will restrict user access for a time frame specified in your configuration (5 seconds accordingly to).

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 95% 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

Unknown

Total

1

Last Release

1979d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/88cc1da610249ec60eef2930c6680cc98b66ebdec6068ef02e5cb7555ee7fa1b?d=identicon)[NovikovViktor](/maintainers/NovikovViktor)

---

Top Contributors

[![nowiko](https://avatars.githubusercontent.com/u/8058373?v=4)](https://github.com/nowiko "nowiko (38 commits)")[![alexandrzhulev](https://avatars.githubusercontent.com/u/6017132?v=4)](https://github.com/alexandrzhulev "alexandrzhulev (2 commits)")

---

Tags

phprequestsrestrictionssymfonysymfony-bundlerequestsymfonygetpostrestricthttp verbsLimitations

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/nw-request-limit-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/nw-request-limit-bundle/health.svg)](https://phpackages.com/packages/nw-request-limit-bundle)
```

###  Alternatives

[nucleos/user-bundle

Lightweight user management for symfony

61380.7k5](/packages/nucleos-user-bundle)[elementaryframework/water-pipe

URL routing framework and requests/responses handler for PHP

254.6k4](/packages/elementaryframework-water-pipe)[adactive-sas/saml2-bridge-bundle

Symfony bundle that provide a SAML Identity Provider (idp).

123.5k](/packages/adactive-sas-saml2-bridge-bundle)

PHPackages © 2026

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