phpexperts/neverbounce 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

phpexperts/neverbounce

Composer 安装命令:

composer require phpexperts/neverbounce

包简介

A quick and easy client for the NeverBounce API.

README 文档

README

TravisCI Maintainability Test Coverage

NeverBounce Client is a PHP Experts, Inc., Project aimed at easily accessing the NeverBounce API.

Installation

Via Composer

composer require phpexperts/neverbounce

Usage

Validate a single email address

    // Build the client.
    $client = NeverBounceClient::build();
    
    // Quickly determine if an email is valid or not.
    $response = $client->isValid('theodore@phpexperts.pro');
    // Output: true or false
    
    // Get details as to why an email is valid or not.
    $emailValidationDTO = $client->validate('doesnt-exist@gmail.com');

    /* Output: 
    {
      +"status": "success"
      +"result": "invalid"
      +"flags": array:4 [
        0 => "free_email_host"
        1 => "has_dns"
        2 => "has_dns_mx"
        3 => "smtp_connectable"
      ]
      +"suggested_correction": ""
      +"execution_time": 309
    }
    */

Bulk email address validation

    // Build the client.
    $client = NeverBounceClient::build();

    // Create the job over at NeverBounce.
    $jobId = $client->bulkVerify(['support@neverbounce.com', 'sales@phpexperts.pro']);
    
    // Periodicly check the job for results.
    for ($a = 0; $a < 30; ++$a) {
        $bulkValidationDTO = $client->checkJob($jobId);
        if (!$bulkValidationDTO) {
            sleep(1);
        }
        
        break;
    }
    
    /** Output:
    BulkValidationDTO [
        'status'           => 'success',
        'id'               => 2917483,
        'job_status'       => 'complete',
        'filename'         => 'bulk-1559703280.csv',
        'created_at'       => Carbon: '2019-06-04 22:54:41',
        'started_at'       => Carbon: '2019-06-04 22:54:42',
        'finished_at'      => Carbon: '2019-06-04 22:54:47',
        'total'            => ListStatsDTO [
            'records'    => 7,
            'billable'   => 5,
            'processed'  => 7,
            'valid'      => 3,
            'invalid'    => 3,
            'catchall'   => 1,
            'disposable' => 0,
            'unknown'    => 0,
            'duplicates' => 1,
            'bad_syntax' => 1,
        ],
        'bounce_estimate'  => 28.571428571429,
        'percent_complete' => 100,
        'execution_time'   => 12,
    ]
     */

All DTOs are easily converted to an array, JSON, and are serializable. See the SimpleDTO Project for details.

  • To an array: $listStats->toArray()
  • To JSON: json_encode($listStats);
  • Serialize (as JSON): serialize($listStats);

Use cases

PHPExperts\NeverBounceClient
✔ Can build itself
✔ Will validate a good email
✔ Will validate a catch all email
✔ Will validate an invalid domain email
✔ Will validate an invalid account email
✔ Will detect free email hosts
✔ Can determine if an email is good
✔ Can determine if an email has an invalid domain
✔ Can determine if an email has an invalid account

PHPExperts\NeverBounceClient: Bulk Validations
✔ Can submit a bulk validation request
✔ Can poll job until completed
✔ Will retrieve bulk validation results

Testing

# Run without needing a NeverBounce key / not using up your free quota.
phpunit --testdox --exclude-group=thorough

# Run the full suite.
phpunit --testdox 

Contributors

Theodore R. Smith theodore@phpexperts.pro
GPG Fingerprint: 4BF8 2613 1C34 87AC D28F 2AD8 EB24 A91D D612 5690
CEO: PHP Experts, Inc.

License

MIT license. Please see the license file for more information.

phpexperts/neverbounce 适用场景与选型建议

phpexperts/neverbounce 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 239 次下载、GitHub Stars 达 1, 最近一次更新时间为 2019 年 06 月 05 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「api」 「neverbounce」 「neverbounce client」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 phpexperts/neverbounce 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 phpexperts/neverbounce 我们能提供哪些服务?
定制开发 / 二次开发

基于 phpexperts/neverbounce 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 239
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 13
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-06-05