zbateson/php-dummy-sendmail
Composer 安装命令:
composer require --dev zbateson/php-dummy-sendmail
包简介
sendmail dummy for testing written in PHP
README 文档
README
sendmail dummy for testing written in PHP
PHP based 'sendmail' dummy for writing emails to a directory for testing.
- Predictable and configurable file-naming
- Configurable output directory and file extension
Installation
Currently, installing involves either creating the phar archive from the repo, or running it directly from the repo.
Dependencies must be downloaded and installed with composer - to do so:
composer install
This depends on how composer is installed, if that fails please ensure composer is installed and review composer's documentation at: https://getcomposer.org/doc/00-intro.md
To create the phar archive, after cloning, use clue/phar-composer and run phar-composer build to create php-dummy-sendmail.phar. Once created, optionally move it to /usr/local/bin or configure sendmail with php path/to/php-dummy-sendmail.phar.
mv php-dummy-sendmail.phar /usr/local/bin/php-sendmail
clue/phar-composer will automatically set execute permissions. you may need to run this with sudo
To run directly without creating a phar archive, the main project file sendmail, is an executable file in bash and can be run with:
php sendmail
In Windows php-dummy-sendmail can be run with:
php sendmail
Configure php.ini
Change the sendmail configuration in php.ini:
sendmail = /usr/local/bin/php-sendmail --directory /path/to/output-dir
Usage
php-sendmail [--directory[="..."]] [--timestamp[="..."]] [--increment-file[="..."]] [--input-file[="..."]] [--file-extension[="..."]] [--print] [to]
Example: php-sendmail user@example.com --directory /path/to/output/dir --timestamp "Y-m-d H:i:s:u" --file-extension txt
php-sendmail reads from STDIN by default, so the above example run on the command line would block.
Command-line Options
--directory - specifies the default directory to read/write to (useful if not the current dir)
--timestamp - PHP date() timestamp format (with 'u' support), used to format the output file name. Defaults to 'Y-m-d H:i:s:u'
--increment-file - Specifies a file to save an index number for auto-increment functionality. File names are numbered with this option set.
--file-extension - Sets the file extension to use for saved files.
--input-file - Specify an input file (useful for debugging)
--print - Simply prints the output
zbateson/php-dummy-sendmail 适用场景与选型建议
zbateson/php-dummy-sendmail 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 54 次下载、GitHub Stars 达 2, 最近一次更新时间为 2019 年 01 月 04 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「testing」 「sendmail」 「PHP mail」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 zbateson/php-dummy-sendmail 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 zbateson/php-dummy-sendmail 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 zbateson/php-dummy-sendmail 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Testing Suite For Lumen like Laravel does.
Magento2 email providers integration (smtp, mandrill, amazon ses)
A powerful replacement for PHP's mail() function with MIME support, attachments, and a custom transport hook
The PHP SDK for Checkmango
Magento2 email providers integration (smtp, mandrill, amazon ses)
Alfabank REST API integration
统计信息
- 总下载量: 54
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2019-01-04