2017 © Pedro Peláez
 

symfony-bundle faye-app-bundle

image

cravler/faye-app-bundle

  • Monday, July 16, 2018
  • by cravler
  • Repository
  • 1 Watchers
  • 0 Stars
  • 2,131 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 7 % Grown

The README.md

CravlerFayeAppBundle

This bundle depends on faye-app., (*1)

Installation

Step 1: Download the Bundle

``` bash composer require cravler/faye-app-bundle:2.x-dev, (*2)


This command requires you to have Composer installed globally, as explained in the [installation chapter](https://getcomposer.org/doc/00-intro.md) of the Composer documentation. ### Step 2: Enable the Bundle This bundle should be automatically enabled by [Flex](https://symfony.com/doc/current/setup/flex.html). In case you don't use Flex, you'll need to manually enable the bundle by adding the following line in the `config/bundles.php` file of your project: ``` php <?php // config/bundles.php return [ // ... Cravler\FayeAppBundle\CravlerFayeAppBundle::class => ['all' => true], ];

Step 3: Add routing

``` yaml, (*3)

config/routes.yaml

cravler_faye_app: resource: "@CravlerFayeAppBundle/Resources/config/routing.yaml", (*4)


### Step 4: Include Javascript To include the relevant javascript libraries necessary for FayeApp, add these to your root layout file. ``` twig {{ faye_app_javascript() }}

Usage

Create entry-point

``` php <?php // .../Acme/DemoBundle/EntryPoint/Example.php, (*5)

namespace Acme\DemoBundle\EntryPoint;, (*6)

use Cravler\FayeAppBundle\EntryPoint\AbstractEntryPoint;, (*7)

class Example extends AbstractEntryPoint { public function getId() { return 'acme-demo.example'; } }, (*8)


### Register entry-point ``` xml <services> ... <service id="acme.demo.entry_point.example" class="Acme\DemoBundle\EntryPoint\Example"> <call method="setEntryPointManager"> <argument type="service" id="cravler_faye_app.service.entry_point_manager" /> </call> <tag name="cravler_faye_app.entry_point" /> </service> ... </services>

Subscribing to channels

``` html, (*9)


### Sending messages ``` html

Configuration

The default configuration for the bundle looks like this:, (*10)

``` yaml cravler_faye_app: example: false user_provider: false #security.user.provider.concrete.[provider_name] route_url_prefix: /faye-app use_request_uri: false secret: ThisTokenIsNotSoSecretChangeIt app: scheme: ~ host: 127.0.0.1 port: ~ mount: /pub-sub options: {}, (*11)


## License This bundle is under the MIT license. See the complete license in the bundle:

LICENSE ```, (*12)

The Versions

16/07 2018

dev-master

9999999-dev

  Sources   Download

MIT

The Requires

 

symfony sockets faye websockets pubsub node.js bayeux