danjones000/php-notmuch
Composer 安装命令:
composer require danjones000/php-notmuch
包简介
PHP library for accessing notmuch email
README 文档
README
This library can be used as an API for accessing your notmuch database.
This is a very early release. It's probably really buggy. You really shouldn't use it yet.
Installation
Install with:
composer require danjones000/php-notmuch
However, you probably don't want to use this yet. You'll get a lot of BadMethodCallExceptions.
Usage
use Danjones\Notmuch\Notmuch;
$notmuch = new Notmuch();
// or, to specify path to notmuch command
$notmuch = new Notmuch('/path/to/notmuch.sh');
// notmuch command must be in your PATH, or an absolute path.
$notmuch->new(); // Fetches new files into database
$notmuch->search(['tag:inbox', 'AND', 'tag:unread']); // Returns an array of messages.
$notmuch->tag(['-unread'], ['tag:unread']); // Untag all unread messages as unread
// ...
The API closely models the CLI usage.
Future development plans.
In the future, a more object-oriented approach will be added. I'd like to be able to do something like:
$messages = $notmuch->search(['tag:inbox']); // $messages will be a MessageCollection
$messages->tag(['+newtag']);
$first = $messages->first(); // $first will be a Message object
$first->tag(['+anothertag']);
Development
Merge requests are welcome.
Code should be PSR-12 compliant.
统计信息
- 总下载量: 4
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-04-13