Giter Club home page Giter Club logo

jolinotif's Introduction

JoliNotif demo

Total Downloads Latest Stable Version Latest Unstable Version Build Status SensioLabsInsight

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

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 is also provided to use JoliNotif from CLI:

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

Further documentation

Discover more by reading the docs:

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

And finally some meta documentation:

Credits

License

JoliNotif is licensed under the MIT License - see the LICENSE file for details.

jolinotif's People

Contributors

pyrech avatar lyrixx avatar tamtamchik avatar carusogabriel avatar matthieumota avatar nunomaduro avatar pborreli avatar raphael-da-silva avatar javiereguiluz avatar julienbourdeau avatar jeremyfreeagent avatar kamilsk avatar gremo avatar paulmallet avatar xavierlacot avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.