rpkamp/mailhog-client 问题修复 & 功能扩展

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

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

rpkamp/mailhog-client

Composer 安装命令:

composer require rpkamp/mailhog-client

包简介

Mailhog API Client for PHP

README 文档

README

A simple PHP (8.1+) client for Mailhog.

Design Goals

  • As little dependencies as possible
  • Simple single client for both Mailhog V1 API as well as Mailhog V2 API
  • Integration tests on all endpoints, both happy path and failure paths

Installation

This package does not require any specific HTTP client implementation, but is based on HTTPlug, so you can inject your own HTTP client of choice. So you when you install this library make sure you either already have an HTTP client installed, or install one at the same time as installing this library, otherwise installation will fail.

composer require rpkamp/mailhog-client <your-http-client-of-choice>

For more information please refer to the HTTPlug documentation for Library Users.

Usage

<?php

use rpkamp\Mailhog\MailhogClient;

$client = new MailhogClient(new SomeHttpClient(), new SomeRequestFactory(), 'http://my.mailhog.host:port/');

Where SomeHttpClient is a class that implements Http\Client\HttpClient from HTTPlug and SomeMessageFactory is a class that implements Http\Message\RequestFactory from HTTPlug, and my.mailhog.host is the hostname (or IP) where mailhog is running, and port is the port where the mailhog API is running (by default 8025).

Run tests

Make sure you have Mailhog running and run:

make test

Running Mailhog for tests

You can either run your own instance of Mailhog or use the provided Dockerfile to run one for you. To run Mailhog with Docker make sure you have Docker insalled and run:

docker-compose up -d

Mailhog ports for tests

To prevent port collissions with any other Mailhog instances while testing the tests expect Mailhog to listen to SMTP on port 2025 (instead of the default 1025) and to HTTP traffic on port 9025 (instead of the default 8025).

If you want different ports you can copy phpunit.xml.dist to phpunit.xml and change the port numbers in the environment variables therein.

rpkamp/mailhog-client 适用场景与选型建议

rpkamp/mailhog-client 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 764.57k 次下载、GitHub Stars 达 24, 最近一次更新时间为 2017 年 11 月 11 日, 在 PHP 生态内属于活跃度较高的组件。

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

围绕 rpkamp/mailhog-client 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

  • 总下载量: 764.57k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 24
  • 点击次数: 12
  • 依赖项目数: 5
  • 推荐数: 0

GitHub 信息

  • Stars: 24
  • Watchers: 1
  • Forks: 16
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-11-11