Control emails with black and white lists; make lists of domains using regular expressions and validate emails with them
Go to file
2016-04-30 21:30:51 +03:00
src Used setters into class constructors 2016-04-30 12:26:39 +03:00
tests Removed redundant feature from AntiTempmailRepo class 2016-04-30 12:24:24 +03:00
.gitignore Initial commit: base git repo structure, base Storage implementation and tests 2016-04-26 23:29:38 +03:00
CHANGELOG.md The initial description of the repository, preparation for publishing on packagist 2016-04-30 21:14:37 +03:00
composer.json The initial description of the repository, preparation for publishing on packagist 2016-04-30 21:14:37 +03:00
CONTRIBUTING.md The initial description of the repository, preparation for publishing on packagist 2016-04-30 21:14:37 +03:00
LICENSE.md Initial commit: base git repo structure, base Storage implementation and tests 2016-04-26 23:29:38 +03:00
phpunit.xml.dist Initial commit: base git repo structure, base Storage implementation and tests 2016-04-26 23:29:38 +03:00
README.md Fixed trendy shields 2016-04-30 21:30:51 +03:00

PHP Tempmail Buster

Latest Version on Packagist Software License Total Downloads

Расширяемый класс для блокировки E-mail адресов определённых доменов или организации белого списка допустимых доменов. Реализует лоадер для загрузки и валидации по списку из Anti Tempmail Repo.

Установка

Install the latest version with

$ composer require ely/php-tempmailbuster

Использование

Пример использования с применением стандартного лоадера:

use Ely\TempMailBuster\Loader\AntiTempmailRepo;
use Ely\TempMailBuster\Storage;
use Ely\TempMailBuster\Validator;

// Создаём класс лоадера
$loader = new AntiTempmailRepo();
// Загружаем из него данные и передаём их в объект хранилища
$storage = new Storage($loader->load();
// или используем статичный метод для работы с лоадерами
$storage = Storage::fromLoader($loader);
// Создаём класс-валидатор
$validator = new Validator($storage);
$validator->validate('team@ely.by'); // = true
$validator->validate('hy42k@sendspamhere.com'); // = false

// Включаем режим белого списка
$validator->whitelistMode();
$validator->validate('team@ely.by'); // = false
$validator->validate('hy42k@sendspamhere.com'); // = true

Конструктор принимает 2 аргумента: первичное и вторичное хранилище. Первичное хранилище работает в соответствии с выбранным режимом работы библиотеки, а вторичное (если указано) позволяет добавить исключение из правил. Смотрите больше примеров вызова метода validate() в тестах.

Change log

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Credits

This package was designed and developed within the Ely.by project team. We also thank all the contributors for their help.

License

The MIT License (MIT). Please see License File for more information.