linkorb/notifier

Notifier,直接通知。

0.3.0 2013-02-25 22:23 UTC

This package is auto-updated.

Last update: 2024-08-29 03:37:24 UTC


README

Build Status

Notifier充当通知中心。

收件人将只接收他们注册的消息。

用法

<?php

$notifier = new Notifier\Notifier();
$notifier->pushProcessor(function($message) {
    $recipients = $message->getRecipients();
    // only set the filters just before sending.
    foreach ($recipients as &$recipient) {
        if ($recipient->getData() == 'Dries') {
            $recipient->addType('test', 'var_dump');
        }
    }
    return $message;
});
$notifier->pushHandler(new Notifier\Handler\VarDumpHandler(array('test', 'mailing')));

$message = new Notifier\Message\Message('test');
$message->addRecipient(new Notifier\Recipient\Recipient('Dries'));

$notifier->sendMessage($message);

当前状态

该项目仍在开发中,还不适用于生产环境。

处理器

  • MailHandler:通过邮件发送消息。
  • SwiftMailerHandler:使用Swift Mailer发送消息。
  • ProwlAppHandler:通过Prowl将消息发送到iOS。
  • PushoverHandler:通过Pushover将消息发送到iOS/Android。
  • NullHandler:完全忽略消息。
  • VarDumpHandler:将输出发送到屏幕。(用于调试)

许可证

Notifier在MIT许可证下授权。