PHPackages                             infuse/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. [Framework](/categories/framework)
4. /
5. infuse/csrf

ActiveLibrary[Framework](/categories/framework)

infuse/csrf
===========

Anti-CSRF module for Infuse Framework

1.1(8y ago)1200MITPHPPHP &gt;=7.0.0

Since Oct 5Pushed 7y ago1 watchersCompare

[ Source](https://github.com/infusephp/csrf)[ Packagist](https://packagist.org/packages/infuse/csrf)[ RSS](/packages/infuse-csrf/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (2)Dependencies (5)Versions (3)Used By (0)

csrf
====

[](#csrf)

[![Build Status](https://camo.githubusercontent.com/7aa29e8cfdfa0527e9ca0e0f9a2dca18c26728a60a68ae3b163031b2bb0cb06f/68747470733a2f2f7472617669732d63692e6f72672f696e667573657068702f637372662e7376673f6272616e63683d6d6173746572267374796c653d666c6174)](https://travis-ci.org/infusephp/csrf)[![Coverage Status](https://camo.githubusercontent.com/e538e787e9ff8b5136f4280716de7f64151bd841010937fab934b5ec30000d00/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f696e667573657068702f637372662f62616467652e7376673f7374796c653d666c6174)](https://coveralls.io/r/infusephp/csrf)[![Latest Stable Version](https://camo.githubusercontent.com/bcea13ff199cd4c356b88d5dd6396a0a3a37c59388d978e724c503ea9248e904/68747470733a2f2f706f7365722e707567782e6f72672f696e667573652f637372662f762f737461626c652e7376673f7374796c653d666c6174)](https://packagist.org/packages/infuse/csrf)[![Total Downloads](https://camo.githubusercontent.com/ecf30fa3a9a75cadc17b29a997137bd55f97af29710e95c83d830a4ba4a3a4dd/68747470733a2f2f706f7365722e707567782e6f72672f696e667573652f637372662f646f776e6c6f6164732e7376673f7374796c653d666c6174)](https://packagist.org/packages/infuse/csrf)[![HHVM Status](https://camo.githubusercontent.com/9aa4e623ec8da269edcf398e56725062ef32aa6cf605885b144721634253ae02/687474703a2f2f6868766d2e683463632e64652f62616467652f696e667573652f637372662e7376673f7374796c653d666c6174)](http://hhvm.h4cc.de/package/infuse/csrf)

CSRF protection for Infuse Framework. Built on [symfony/security-csrf](https://github.com/symfony/security-csrf/).

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

[](#installation)

1. Install the package with [composer](http://getcomposer.org):

    ```
    composer require infuse/csrf

    ```
2. Add the services in your app's configuration:

    ```
    'services' => [
       // ...
       'csrf' => 'Infuse\Csrf\Csrf',
       'csrf_tokens' => 'Infuse\Csrf\CsrfTokens',
       // ...
    ]
    ```
3. Add the middleware to your app:

    ```
    $app->middleware($app['csrf']);
    ```

Usage
-----

[](#usage)

Any POST, PUT, PATCH, and DELETE request that has the middleware installed will check for a valid CSRF token. With a line of code you can add CSRF tokens to a form (Smarty example):

```

   {$app.csrf->render($req) nofilter}

```

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

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

Total

2

Last Release

3118d ago

PHP version history (2 changes)1.0PHP &gt;=5.4.0

1.1PHP &gt;=7.0.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/2d31f148b30ea3f288fb9e748f6a1dbd7c145a4bd0af74b4687812227221608a?d=identicon)[Jaredtking](/maintainers/Jaredtking)

---

Tags

frameworksecuritycsrfinfuse

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[fastsitephp/fastsitephp

A Modern Open Source Framework for building High Performance Websites and API’s with PHP

1302.8k1](/packages/fastsitephp-fastsitephp)[contao-community-alliance/dc-general

Universal data container for Contao

1579.5k90](/packages/contao-community-alliance-dc-general)

PHPackages © 2026

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