PHPackages                             munichresearch/yii2\_cached\_purifier - 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. [Caching](/categories/caching)
4. /
5. munichresearch/yii2\_cached\_purifier

ActiveLibrary[Caching](/categories/caching)

munichresearch/yii2\_cached\_purifier
=====================================

Cache purified content to increase performance

00PHP

Since Mar 14Pushed 8y agoCompare

[ Source](https://github.com/linuskohl/yii2_cached_purifier)[ Packagist](https://packagist.org/packages/munichresearch/yii2_cached_purifier)[ RSS](/packages/munichresearch-yii2-cached-purifier/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (1)Used By (0)

yii2\_cached\_purifier
======================

[](#yii2_cached_purifier)

Yii2 component that caches the results of [HTML Purifier](http://htmlpurifier.org/) in a cache that implements the [yii\\caching\\CacheInterface](http://www.yiiframework.com/doc-2.0/yii-caching-cacheinterface.html). This will remove malicious code (XSS) from strings and make it standards compliant. More information available at the [Yii2 Security best practices](http://www.yiiframework.com/doc-2.0/guide-security-best-practices.html#avoiding-xss)

Requirements
------------

[](#requirements)

- "yiisoft/yii2": "&gt;2.0.0"
- "ezyang/htmlpurifier": "~4.9.3"
- "php": "&gt;=5.2"

Install
-------

[](#install)

Via Composer

```
$ composer require linuskohl/yii2_cached_purifier dev-master
```

or add

```
"linuskohl/yii2_cached_purifier": "dev-master"

```

to the require section of your composer.json file.

Configuration
-------------

[](#configuration)

To use this component, simply add the following code in your application configuration:

```
return [
    //....
    'components' => [
        'cache'  => [
            'class' => 'yii\redis\Cache',
            'redis' => [
                'hostname' => 'localhost',
                'port'     => 6379,
                'database' => 0,
            ]
        ],
        'cached_purifier' => [
            'class'          => '\munichresearch\yii2_cached_purifier\CachedPurifier',
            'cache'          => 'redis', // name of the cache component
            'cache_duration' => 0, // Duration to store the secured strings. Set it to 0 to disable expiration */
            'key_prefix'     => 'secured_strings::', // Prefix for the cache keys
            'key_hash'       => 'sha512' // Hash used to create key
        ],
    ],
];
```

Usage
-----

[](#usage)

```

```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

18

—

LowBetter than 7% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2761641?v=4)[Linus Kohl](/maintainers/linuskohl)[@linuskohl](https://github.com/linuskohl)

---

Top Contributors

[![linuskohl](https://avatars.githubusercontent.com/u/2761641?v=4)](https://github.com/linuskohl "linuskohl (2 commits)")

---

Tags

cachepurifieryiiyii2

### Embed Badge

![Health badge](/badges/munichresearch-yii2-cached-purifier/health.svg)

```
[![Health](https://phpackages.com/badges/munichresearch-yii2-cached-purifier/health.svg)](https://phpackages.com/packages/munichresearch-yii2-cached-purifier)
```

###  Alternatives

[iazaran/smart-cache

Smart Cache is a caching optimization package designed to enhance the way your Laravel application handles data caching. It intelligently manages large data sets by compressing, chunking, or applying other optimization strategies to keep your application performant and efficient.

21114.2k](/packages/iazaran-smart-cache)

PHPackages © 2026

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