PHPackages                             ngatngay/firewall-php - 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. [Security](/categories/security)
4. /
5. ngatngay/firewall-php

ActiveLibrary[Security](/categories/security)

ngatngay/firewall-php
=====================

Simple Antiflood

040PHP

Since Dec 27Pushed 3y ago1 watchersCompare

[ Source](https://github.com/ngatngay/firewall-php)[ Packagist](https://packagist.org/packages/ngatngay/firewall-php)[ RSS](/packages/ngatngay-firewall-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

Firewall for PHP
================

[](#firewall-for-php)

DQH Firewall Mod

Yêu cầu
-------

[](#yêu-cầu)

- PHP 7.4+ (Chưa kiểm tra trên các phiên bản PHP khác :))

Cài đặt
-------

[](#cài-đặt)

```
composer require ngatngay/firewall-php:dev-main

```

Sử dụng
-------

[](#sử-dụng)

```
new \NgatNgay\Firewall([
    // Danh Sách Tên Miền Cho Phép POST (để domain của bạn)
    'firewall_domains'                 => [
        'buidoi.net',
        'www.buidoi.net',
        'localhost',
        'ngatngay.gq'
    ],

    // Luôn bật tường lửa 2 lớp: 1 - tắt: 0
    'firewall_2nd_layer'               => 1,

    // Thời gian đợi sau mỗi đợt request
    'firewall_wait_time'               => 20,

    // Số Request tối đa trong 1 đợt
    'firewall_penalty_allow'           => 5,

    // Giới hạn khóa IP nếu lượng request vượt qua số này trong 1 phút
    'firewall_request_to_block_in_min' => 200,

    // Thời gian đợi (ms)
    'firewall_wait_allow'              => 3000
]);
```

Demo
----

[](#demo)

- index.php

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity25

Early-stage or recently created project

 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.

### Community

Maintainers

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

---

Top Contributors

[![pmtpro](https://avatars.githubusercontent.com/u/25657732?v=4)](https://github.com/pmtpro "pmtpro (5 commits)")

### Embed Badge

![Health badge](/badges/ngatngay-firewall-php/health.svg)

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

###  Alternatives

[defuse/php-encryption

Secure PHP Encryption Library

3.9k162.4M214](/packages/defuse-php-encryption)[roave/security-advisories

Prevents installation of composer packages with known security vulnerabilities: no API, simply require it

2.9k97.3M6.4k](/packages/roave-security-advisories)[mews/purifier

Laravel 5/6/7/8/9/10 HtmlPurifier Package

2.0k16.7M113](/packages/mews-purifier)[robrichards/xmlseclibs

A PHP library for XML Security

41278.1M118](/packages/robrichards-xmlseclibs)[bjeavons/zxcvbn-php

Realistic password strength estimation PHP library based on Zxcvbn JS

86917.5M63](/packages/bjeavons-zxcvbn-php)[enlightn/security-checker

A PHP dependency vulnerabilities scanner based on the Security Advisories Database.

33732.2M110](/packages/enlightn-security-checker)

PHPackages © 2026

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