2017 © Pedro Peláez
 

library growler

Growl binding for PHP

image

growler/growler

Growl binding for PHP

  • Sunday, January 22, 2012
  • by rocco.zanni
  • Repository
  • 0 Watchers
  • 14 Stars
  • 79 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Growler - A pure PHP Growl notification library

Build Status, (*1)

Class loading

If you have installed the package with composer, it will provide autoloading feature:, (*2)

require_once 'vendor/.composer/autoload.php';

Otherwise, if you already use in your project a PSR-0 compliant autoloader, simply register the "Growler" namespace:, (*3)

// This is based on the Symfony2 Class Loader
$loader->registerNamespace('Growler', 'growler/src');

Otherwise, a basic autoloader is included in the Growler distribution:, (*4)

require_once 'growler/src/Growler/ClassLoader.php';
Growler\ClassLoader::register();

UDP protocol

Historical versions of Growl (< 1.3), listen to the UDP port 9887 for incoming messages that represents notifications to display, (*5)

The protocol is very simple:, (*6)

  • supports only title and message, no custom icon
  • on the same socket you can send as many messages as you want, no response from the other side

The UDP procol implementation is feature-complete., (*7)

This is an example for creating a UDP based transport:, (*8)

$connection  = new Growler\Connection("udp", "localhost", 9887);
$transport   = new Growler\Transport\Udp($connection);

GNTP protocol

From Growl 1.3 has been introduced the new TCP-based GNTP protocol., (*9)

GNTP is a protocol to allow two-way communication between applications and centralized notification systems such as Growl for Mac OS X and to allow two-way communication between two machines running centralized notification systems for notification forwarding purposes., (*10)

Missing GNTP features:, (*11)

  • Message encryption. In the current version of Growl (1.3.2), encryption is not supported yet. Is only defined in the protocol specification
  • Subscribing and callbacks.

This is an example for creating a GNTP based transport:, (*12)

$connection  = new Growler\Connection("tcp", "localhost", 23053);
$transport   = new Growler\Transport\Gntp($connection);

Password protection

Either the UDP and the GNTP protocols, support server password. Just add the password as the second parameter in transport creation:, (*13)

$transport   = new Growler\Transport\Gntp($connection, "secret");

Other TODOs

  • Error handling
  • A Facade for simpler use out-of-the-box

Examples

Code samples are available in the "examples" directory, (*14)

The Versions

22/01 2012

dev-master

9999999-dev http://github.com/roccozanni/growler

Growl binding for PHP

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

notifications growl gntp