PHP code example of lsv / pusher-bundle

1. Go to this page and download the library: Download lsv/pusher-bundle library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

lsv / pusher-bundle example snippets


# app/AppKernel.php
public function registerBundles()
{
    $bundles = [
        new Lsv\PusherBundle\LsvPusherBundle(),
    ];
}

$this->get('lsv_pusher.pusher')->trigger('channel', 'event-name', $data);

use Lsv\PusherBundle\Service\PusherService

class YourClass
{
    public function __construct(PusherService $pusher)
    {
    }
}
yml
lsv_pusher:
    curl_options:
        - !php/const:CURLOPT_IPRESOLVE: !php/const:CURL_IPRESOLVE_V4
        - !php/const:CURLOPT_SSL_VERIFYSTATUS: false