The initial description of the repository, preparation for publishing on packagist

This commit is contained in:
ErickSkrauch 2016-04-30 21:14:37 +03:00
parent 094ef807c5
commit 5868d173eb
4 changed files with 118 additions and 5 deletions

View File

@ -1 +1,9 @@
// TODO # Change Log
All notable changes to `elyby/php-tempmailbuster` are documented in this file using the
[Keep a CHANGELOG](http://keepachangelog.com/) principles.
## 1.0.0 - 2016-04-30
### Added
* Initial release

34
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,34 @@
# Contributing
* Coding standard for the project is [PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)
* Any contribution must provide tests for additional introduced conditions
## Installation
To install the project and run the tests, you need to clone it first:
```sh
$ git clone git@github.com:elyby/php-tempmailbuster.git
```
You will then need to run a composer installation:
```sh
$ cd php-tempmailbuster
$ curl -s https://getcomposer.org/installer | php
$ php composer.phar update
```
## Testing
The PHPUnit version to be used is the one installed as a dev- dependency via composer:
```sh
$ ./vendor/bin/phpunit
```
or
```sh
$ composer test
```

View File

@ -1 +1,66 @@
// TODO # PHP Tempmail Buster
[![Software License][ico-license]](LICENSE.md)
Расширяемый класс для блокировки E-mail адресов определённых доменов или организации белого списка допустимых доменов.
Реализует лоадер для загрузки и валидации по списку из [Anti Tempmail Repo](https://github.com/elyby/anti-tempmail-repo).
## Установка
Install the latest version with
```sh
$ composer require ely/php-tempmailbuster
```
## Использование
Пример использования с применением стандартного лоадера:
```php
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()` в [тестах](tests/ValidatorTest.php).
## Change log
Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.
## Contributing
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
## Credits
This package was designed and developed within the [Ely.by](http://ely.by) project team. We also thank all the
[contributors](link-contributors) for their help.
## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square
[link-author]: https://github.com/ErickSkrauch
[link-contributors]: ../../contributors

View File

@ -1,8 +1,15 @@
{ {
"name": "ely/php-tempmailbuster", "name": "ely/php-tempmailbuster",
"description": "Control emails with black and white lists; make lists of domains using regular expressions and validate emails with them",
"keywords": ["email", "validation"],
"homepage": "https://github.com/elyby/anti-tempmail-repo",
"license": "MIT", "license": "MIT",
"type": "library", "type": "library",
"authors": [ "authors": [
{
"name": "Ely.by team",
"email": "team@ely.by"
},
{ {
"name": "ErickSkrauch", "name": "ErickSkrauch",
"email": "erickskrauch@ely.by" "email": "erickskrauch@ely.by"
@ -10,7 +17,6 @@
], ],
"require": { "require": {
"php" : "~5.4 | ~7.0", "php" : "~5.4 | ~7.0",
"lib-curl" : "*",
"ely/anti-tempmail-repo" : "*" "ely/anti-tempmail-repo" : "*"
}, },
"require-dev": { "require-dev": {
@ -23,7 +29,7 @@
"name": "ely/anti-tempmail-repo", "name": "ely/anti-tempmail-repo",
"version": "0.0.0", "version": "0.0.0",
"source": { "source": {
"url": "https://github.com/elyby/anti-tempmail-repo", "url": "https://github.com/elyby/anti-tempmail-repo.git",
"type": "git", "type": "git",
"reference": "master" "reference": "master"
} }