Popularity
6.8
Growing
Activity
7.4
Growing
1,399
48
93

Description

PHP >= 5.4

JoliNotif is a PHP library to send notifications to your desktop directly from your script. It takes care of using the right binary available, without having to worry if you're running on Linux, Windows or MacOS.

For example, if you have a long running PHP task - like executing a large test suite, launching a deployment script - you can use JoliNotif to inform your users that a task just finished.

Code Quality Rank: L5
Programming language: PHP
License: MIT License
Tags: Notifications     Notification     Growl     Linux     Windows     MAC    
Latest version: v2.2.0

JoliNotif alternatives and similar libraries

Based on the "Notifications" category.
Alternatively, view JoliNotif alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of JoliNotif or a related project?

Add another 'Notifications' Library

README

About JoliNotif

JoliNotif is a cross-platform PHP library to display desktop notifications. It works on Linux, Windows or MacOS.

Requires PHP >= 7.2 (support for PHP 5 was available in version 1.x, for PHP 7.0 and 7.1 in version < 2.1.0).

Note: This library can not be used in a web context (FPM or equivalent). Use it in your CLI scripts or in a [CRON](doc/04-advanced-usage.md#notification-in-cron)

Installation

Use Composer to install JoliNotif in your project:

composer require "jolicode/jolinotif"

Usage

Use the NotifierFactory to create the correct Notifier (adapted to your OS), then use it to send your notification:

include __DIR__.'/vendor/autoload.php';

use Joli\JoliNotif\Notification;
use Joli\JoliNotif\NotifierFactory;

// Create a Notifier
$notifier = NotifierFactory::create();

// Create your notification
$notification =
    (new Notification())
    ->setTitle('Notification title')
    ->setBody('This is the body of your notification')
    ->setIcon(__DIR__.'/path/to/your/icon.png')
    ->addOption('subtitle', 'This is a subtitle') // Only works on macOS (AppleScriptNotifier)
    ->addOption('sound', 'Frog') // Only works on macOS (AppleScriptNotifier)
;

// Send it
$notifier->send($notification);

A [shell executable](doc/05-cli-usage.md) is also provided to use JoliNotif from CLI:

jolinotif --title "Hello" --body "World"

Further documentation

Discover more by reading the docs:

  • [Basic usage](doc/01-basic-usage.md)
  • [Notification](doc/02-notification.md)
  • [Notifier](doc/03-notifier.md)
  • [Advanced usage](doc/04-advanced-usage.md)
  • [CLI usage](doc/05-cli-usage.md)

You can see the current and past versions using one of the following:

And finally some meta documentation:

  • [versioning and branching models](VERSIONING.md)
  • [contribution instructions](CONTRIBUTING.md)

Credits

License

JoliNotif is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.


*Note that all licence references and agreements mentioned in the JoliNotif README section above are relevant to that project's source code only.