PHPackages                             block/block-csrf - 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. block/block-csrf

ActiveLibrary[Security](/categories/security)

block/block-csrf
================

\[Protect your web site from CSRF attack\]

v0.1.2(11y ago)0291GPLv3PHPPHP &gt;=5.3.3

Since Feb 10Pushed 8y ago1 watchersCompare

[ Source](https://github.com/xuqingfeng/BlockCSRF)[ Packagist](https://packagist.org/packages/block/block-csrf)[ RSS](/packages/block-block-csrf/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (3)Used By (0)

BlockCSRF
---------

[](#blockcsrf)

> protect your web site from csrf attack

[![travis](https://camo.githubusercontent.com/6b39b53357e4f4880c35c482792e6d802f338215c9404b45f2d97eb55922d88a/68747470733a2f2f7472617669732d63692e6f72672f787571696e6766656e672f426c6f636b435352462e737667)](https://camo.githubusercontent.com/6b39b53357e4f4880c35c482792e6d802f338215c9404b45f2d97eb55922d88a/68747470733a2f2f7472617669732d63692e6f72672f787571696e6766656e672f426c6f636b435352462e737667)

### Install

[](#install)

> via composer

```
{
	"require": {
		"block/block-csrf": "0.1.*"
	}
}

```

### How

[](#how)

```
// create instance
$blockCSRF = \Block\BlockCSRF::getInstance();

// generate token
$blockCSRF->generate();

/*
 * check token
 * @return true OR false
 */
$blockCSRF->check($token);
```

### Test

[](#test)

```
phpunit .

```

### License

[](#license)

MIT

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity49

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

2

Last Release

4162d ago

### Community

Maintainers

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

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/block-block-csrf/health.svg)

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

###  Alternatives

[mews/purifier

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

2.0k18.7M143](/packages/mews-purifier)[paragonie/ecc

PHP Elliptic Curve Cryptography library

24820.0k37](/packages/paragonie-ecc)

PHPackages © 2026

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