dev-master
9999999-dev
MIT
The Requires
by Sergei Vizel
symfony sockets faye websockets pubsub node.js bayeux
This bundle depends on faye-app., (*1)
``` 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], ];
``` yaml, (*3)
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() }}
``` 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>
``` html, (*9)
### Sending messages ``` html
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)
MIT
symfony sockets faye websockets pubsub node.js bayeux