PHPackages                             mezon/security - 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. mezon/security

ActiveLibrary[Security](/categories/security)

mezon/security
==============

Small security script

1.1.6(3y ago)37.8k3MITPHPPHP &gt;=7.2.0CI failing

Since Feb 17Pushed 3y ago2 watchersCompare

[ Source](https://github.com/alexdodonov/mezon-security)[ Packagist](https://packagist.org/packages/mezon/security)[ Docs](https://github.com/alexdodonov/mezon-security)[ RSS](/packages/mezon-security/feed)WikiDiscussions master Synced 6d ago

READMEChangelogDependencies (5)Versions (19)Used By (3)

Security validations
====================

[](#security-validations)

[![Build Status](https://camo.githubusercontent.com/45c4ac997b37ee196a5da24add0544f216ed55b671f22b24e5dcaa726580748f/68747470733a2f2f7472617669732d63692e636f6d2f616c6578646f646f6e6f762f6d657a6f6e2d73656375726974792e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/alexdodonov/mezon-security) [![Scrutinizer Code Quality](https://camo.githubusercontent.com/92c51cb24716a3495ce63578ad79b4f4c06cb53dedb21d89356f1abe7d55d2c6/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f616c6578646f646f6e6f762f6d657a6f6e2d73656375726974792f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/alexdodonov/mezon-security/?branch=master) [![codecov](https://camo.githubusercontent.com/3c9a2746665a85a48ba32ef195147b8ceb0d8fe570796ff4bc31cc8b683b1f91/68747470733a2f2f636f6465636f762e696f2f67682f616c6578646f646f6e6f762f6d657a6f6e2d73656375726974792f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/alexdodonov/mezon-security)

Intro
-----

[](#intro)

Mezon provides set of classes wich will help you to validate data from front-end

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

[](#installation)

Just print in console

```
composer require mezon/security

```

And that's all )

Files validations
-----------------

[](#files-validations)

### Size validations

[](#size-validations)

First of all you need to create validator for the file size:

```
use \Mezon\Security;

// here we set that file must not be greater then 2KB
$sizeValidator = new Validators\File\Size(2 * Validators\File\Size::KB);
```

Then you can run validation

```
$security = new SecurityRules();
$security->isUploadedFileValid('uploaded-file', $validators);
```

Here 'uploaded-file' is an index in the $\_FILES array.

### Mime-types validations

[](#mime-types-validations)

You can validate mime types of the uploading files. To do this construct special validator and pass a list of valid mime types to it's constructor

```
// here we set that file must not be greater then 2KB
$sizeValidator = new Validators\File\MymeType(['image/png', 'image/jpeg', 'image/jpg']);
```

And then call isUploadedFileValid like in the example above.

### Image validators

[](#image-validators)

You can use validators for the image size:

```
new Mezon\Security\Validators\File\ImageMaximumWidthHeight(, );

// and

new Mezon\Security\Validators\File\ImageMinimumWidthHeight(, );
```

I'll be very glad if you'll press "STAR" button )
=================================================

[](#ill-be-very-glad-if-youll-press-star-button-)

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity60

Established project with proven stability

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

Recently: every ~123 days

Total

18

Last Release

1153d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/14943896?v=4)[alexdodonov](/maintainers/alexdodonov)[@alexdodonov](https://github.com/alexdodonov)

---

Top Contributors

[![alexdodonov](https://avatars.githubusercontent.com/u/14943896?v=4)](https://github.com/alexdodonov "alexdodonov (22 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/mezon-security/health.svg)

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

###  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)[illuminate/encryption

The Illuminate Encryption package.

9229.7M280](/packages/illuminate-encryption)

PHPackages © 2026

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