2017 © Pedro Peláez
 

symfony-bundle notification-bundle

This Bundle integrates Dklab Realplexor comet server (or other) functionality into a Symfony2 project.

image

lzaztec/notification-bundle

This Bundle integrates Dklab Realplexor comet server (or other) functionality into a Symfony2 project.

  • Monday, April 14, 2014
  • by LZAztec
  • Repository
  • 1 Watchers
  • 1 Stars
  • 309 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

LZAztecNotificationBundle

This bundle provides intergration with a Dklab Realplexor (or other) comet server, (*1)

Installation

For Symfony >2.1:

add to your composer.json file:, (*2)


/// composer.json "require": { // ... "lzaztec/notification-bundle": "dev-master" }, "repositories": [ // ... { "type":"package", "package":{ "name":"dklab/realplexor", "version": "1.41", "source":{ "type":"git", "url":"https://github.com/DmitryKoterov/dklab_realplexor", "reference":"master" }, "autoload":{ "classmap":["api/php/Dklab/"] } } } ]

and run composer update lzaztec/notification-bundle, (*3)

For Symfony 2.0.x:

add to your application deps file:, (*4)

[DklabRealplexor]
    git=https://github.com/DmitryKoterov/dklab_realplexor.git
    target=/Dklab/Reaplexor

[LZAztecNotificationBundle]
    git=https://github.com/LZAztec/LZAztecNotificationBundle.git
    target=/bundles/LZAztec/NotificationBundle

add to your apllication AppKernel.php file:, (*5)


// app/AppKernel.php public function registerBundles() { return array( // ... new LZAztec\NotificationBundle\LZAztecNotificationBundle(), // ... ); }

add to your apllication autoload.php file:, (*6)


// app/autoload.php $loader->registerNamespaces(array( // ... 'LZAztec' => __DIR__.'/../vendor/bundles', )); $loader->registerPrefixes(array( // ... // Load realplexor api 'Dklab_' => __DIR__.'/../vendor/Dklab/Reaplexor/api/php', ));

Configuration

    lz_aztec_notification:
        realplexor_ns: demo_               # Realplexor namespace to use (allowed alphanumeric characters and the underscore character)
        js_api_host: notify.localhost      # JS API host to listen for notifications

Usage

Function init_notification() takes only one parameter, which will contain an instance of notification controller class. To initialize scripts put code {{ init_notification('varName') }} AFTER jquery initialization, next you need to subscribe channel and start listen it., (*7)


<script type="text/javascript" src="path/to/jquery.min.js"></script> {{ init_notification('varName') }} <script type="text/javascript"> $(document).ready(function(){ varName.subscribeChannel('ChannelName'); varName.startListen(); }); </script>

The Versions

14/04 2014

dev-master

9999999-dev

This Bundle integrates Dklab Realplexor comet server (or other) functionality into a Symfony2 project.

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • dklab/realplexor >=1.41

 

by Roman Matveev

notification push comet dklab realplexor