email-concealer

Conceal e-mail addresses in a string by replacing their domain

Github星跟蹤圖

Conceal e-mail addresses in a string

Latest Version on Packagist
Build Status
StyleCI
Quality Score
Total Downloads

Conceal e-mail addresses in a string by replacing their domain. Useful for concealing up production data—like MySQL dumps—so you can use it locally without worrying about having real addresses on your system.

use Spatie\EmailConcealer\Concealer;

$concealer = Concealer::create();

$concealer->conceal('info@spatie.be');
// "info@example.com"

Postcardware

You're free to use this package (it's MIT-licensed), but if it makes it to your production environment we highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using.

Our address is: Spatie, Samberstraat 69D, 2060 Antwerp, Belgium.

We publish all received postcards on our company website.

Installation

You can install the package via composer:

composer require spatie/email-concealer

Usage

To conceal a string, create an Concealer instance. and call the conceal method.

use Spatie\EmailConcealer\Concealer;

$concealer = Concealer::create();

$concealer->conceal('info@spatie.be');
// "info@example.com"

The concealer processes every e-mail address it finds in the string. It will ensure that there aren't any unwanted duplicates if the local-part is the same.

$concealer->conceal('info@spatie.be,info@foo.com,info@bar.com');
// "info@example.com,info-1@foo.com,info-2@bar.com"

Equal e-mail addresses will always conceal to the same concealed address.

$concealer->conceal('info@spatie.be,info@foo.com,info@spatie.be');
// "info@example.com,info-1@example.com,info@example.com"

If you want to use a different domain than example.com, use the domain method to set a new one.

$concealer = Concealer::create()->domain('foo.com');

echo $concealer->conceal('info@spatie.be'); // "info@foo.com"

Changelog

Please see CHANGELOG for more information what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email freek@spatie.be instead of using the issue tracker.

Credits

About Spatie

Spatie is a webdesign agency based in Antwerp, Belgium. You'll find an overview of all our open source projects on our website.

License

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

主要指標

概覽
名稱與所有者spatie/email-concealer
主編程語言PHP
編程語言PHP (語言數: 1)
平台
許可證MIT License
所有者活动
創建於2017-04-20 16:15:15
推送於2022-03-21 13:00:07
最后一次提交
發布數2
最新版本名稱1.0.1 (發布於 )
第一版名稱1.0.0 (發布於 )
用户参与
星數55
關注者數5
派生數6
提交數29
已啟用問題?
問題數0
打開的問題數0
拉請求數4
打開的拉請求數0
關閉的拉請求數27
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?