PHP5.3 的简单 Growl 通知器

v0.1 2012-08-02 09:32 UTC

This package is not auto-updated.

Last update: 2024-09-28 14:37:54 UTC


README

这个库是一个 简单 的 PHP5.3 Growl 通知器

通过 Composer 安装

推荐通过 composer 安装。

{
    "require": {
        "madalynn/growl": "dev-master"
    }
}

示例

<?php

$growl = new Madalynn\Growl\Growl('My application');

// Create a new notification type for the application
$notification = new Madalynn\Growl\Notification\Type('Foobar');

$notification->setIcon('http://foobar.com/myicon.png');
$notification->setDisplayName('Foobar notification type');

$growl->addNotificationType($notification);

// Create a new message for this type
$message = $notification->create('Title', 'Message');

$message->setSticky(true);
$message->setPriority(Madalynn\Growl\Notification\Message::PRIORITY_MODERATE);

// Send the message
$growl->sendNotify($message);