2017 © Pedro Peláez
 

library notification

Library for create notify functionality

image

php-solution/notification

Library for create notify functionality

  • Thursday, March 30, 2017
  • by cleannoise
  • Repository
  • 1 Watchers
  • 1 Stars
  • 18 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 20 % Grown

The README.md

Notification component

Notification component helps developer to create functionality for send notification system., (*1)

Concept

Parts of logic:

  • Context
  • Manager
  • Extension
  • Type
  • Rule
  • Notifier

Main Flow:

1) Client create Context and set some parameter for notification, specify Type of notification(string name or object) and send this info to Manager, (*2)

$type = new NotificationType();
$context = new Context(['parameter' => 'parameter value']);
$notificationManager->notifyType($type, $context);

or, (*3)

$context = new Context(['parameter' => 'parameter value']);
$notificationManager->notifyType(NotificationType::getName(), $context);

2) Manager prepare Type and Context via Extension(if Extension is specified for Manager) 3) Type build Rule/Rules(some simple info for Notifier) 4) Notifier accept Rule(parameters) and send real notification. For example: Email Notifier accept parameters(Rule) for email sending(from, to, cc,text) and send via smtp mail, (*4)

Manager

This is a service for send notification, has 2 public methods for send notification: * notify(string $name, Context $context = null) - will get Type from TypeRegistry * notifyType(TypeInterface $type, Context $context = null) - use accepted Type, (*5)

Extension

Implements functionality for prepare Type, Context info before build Rules, (*6)

Context

Some value object of parameters for Type, (*7)

Type

Rule builder, (*8)

Rule

Some value object of parameters for Notifier, (*9)

Notifier

Implements functionality for real notification sending, (*10)

Installing

  1. Add to your composer.json
    "require": {
        ...
        "php-solution/notification": "dev-master",
        ...
    }    

2) run:, (*11)

    composer update php-solution/notification

Examples:

  • basic usage: link
  • use Symfony context configurator extension, for resolve context parameters link
  • use Symfony Event dispatcher extension link

The Versions

30/03 2017

dev-master

9999999-dev

Library for create notify functionality

  Sources   Download

MIT

The Requires

  • php >=7.1

 

The Development Requires

by Oleksandr Savchenko

30/03 2017

v0.1

0.1.0.0

Library for create notify functionality

  Sources   Download

MIT

The Requires

  • php >=7.1

 

The Development Requires

by Oleksandr Savchenko