emarref/pubnub-bundle

Implement Pubnub into your Symfony application.

This package's canonical repository appears to be gone and the package has been frozen as a result.

Installs: 3 050

Dependents: 0

Suggesters: 0

Security: 0

Stars: 2

Watchers: 2

Forks: 0

Open Issues: 1

Type:symfony-bundle

1.0.0 2015-12-14 19:10 UTC

This package is auto-updated.

Last update: 2022-02-23 08:18:52 UTC


README

Step 1: Download the Bundle

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

$ composer require emarref/pubnub-bundle "^1.0"

This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.

Step 2: Enable the Bundle

Then, enable the bundle by adding it to the list of registered bundles in the app/AppKernel.php file of your project:

<?php
// app/AppKernel.php

// ...
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...

            new Emarref\Bundle\PubnubBundle\EmarrefPubnubBundle(),
        );

        // ...
    }

    // ...
}

Step 3: Configuration

All configuration options on the Pubnub\Pubnub class can be configured. Only publish_key and subscribe_key are required. Default reference is below.

emarref_pubnub:
    publish_key: <your_pub_key> # Required
    subscribe_key: <your_sub_key> # Required
    secret_key: false
    cipher_key: false
    ssl: true
    origin: false
    pem_path: "%kernel.root_dir%/../vendor/pubnub/pubnub/"
    uuid: symfony
    proxy: false
    auth_key: false
    verify_peer: true

Step 4: Usage

Get the pubnub client from the container.

$pubnub = $this->getContainer()->get('emarref.pubnub.client.pubnub');

The $pubnub object is an instance of Pubnub\Pubnub. Usage documentation can be found in the Pubnub repository.