Download the PHP package lsv/pusher-bundle without Composer

On this page you can find all versions of the php package lsv/pusher-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package pusher-bundle

Lsv Pusher Bundle

Pusher.com bundle for symfony

Install

Add the bundle to your AppKernel

Add the needed configuration

There is more configuration availible

Usage

Controller example

In your controller you can use

This will be a Lsv\PusherBundle\Service\PusherService object, which extends \Pusher from pusher/pusher-php-server

Why I extend the original, is because it is not possible to add middlewares to the original, so I added them in my own

As my service extends the original, you can use all the same methods as in https://github.com/pusher/pusher-http-php

Your service

In your service you can add this to your arguments

And in your YourClass

Configuration

Key Description Required Default value Type
app_id Your pusher.com app_id true string
key Your pusher.com key true string
secret Your pusher.com secret true string
host Pusher host false api.pusherapp.com string
timeout HTTP timeout false null integer
encrypted Do you want to push over HTTPS false false boolean
cluster Which cluster are you using, will overwrite your host configuration false null string
curl_options Additional options to send with curl, more information false null array
debug Add debug false false boolean

Even if debug is false, all events will be send, and info will be send to symfony profiler

Full configuration example

curl_options Info

If you a add the constant to curl_options like this

The constant will be translated to the corresponded integer

Symfony 3.2+

In symfony 3.2+, you can do this

Events

Event When Class Methods
lsv_pusher.event.trigger Before trigger is send TriggerEvent getChannels() An array of channel names to publish the event on.

getEvent() Event name

getData() Event data

getSocketId()

isDebug()

isAlreadyEncoded()
lsv_pusher.event.trigger.response After trigger is send, including the response TriggerResponseEvent Same as lsv_pusher.event.trigger but with getResponse()
lsv_pusher.event.triggerbatch Before triggerBatch is send TriggerBatchEvent getBatch() - Array of triggers

isDebug()

isAlreadyEncoded()
lsv_pusher.event.triggerbatch.response After triggerBatch is send, including the response TriggerBatchResponseEvent Same as lsv_pusher.event.triggerbatch but with getResponse()
lsv_pusher.event.channelinfo Before get_channel_info is send ChannelInfoEvent getChannel() The name of the channel

getParams() Additional parameters for the query
lsv_pusher.event.channelinfo.response After get_channel_info is send, including the response ChannelInfoResponseEvent Same as lsv_pusher.event.channelinfo but with getResponse()
lsv_pusher.event.channels Before get_channels is send ChannelsEvent getParams() Additional parameters for the query
lsv_pusher.event.channels.response After get_channels is send, including the response ChannelsResponseEvent Same as lsv_pusher.event.channels but with getResponse()
lsv_pusher.event.get Before get is send GetEvent getPath() Path excluding /apps/APP_ID

getParams() API params
lsv_pusher.event.get.response After get is send, including the response GetResponseEvent Same as lsv_pusher.event.get but with getResponse()

All event classes are in the namespace of Lsv\PusherBundle\Event

In all event classes you can use the NAME constant to get the dispatched event name, fx Lsv\PusherBundle\Event\TriggerBatchEvent::NAME

Symfony profiler

All response requests will be shown in the profiler, just like this

Command

One command is provided to test a pusher.cosend the test to trigger

lsv:pusher:test

Optional options can also be added

Option Description Type Default value
--channels Channels to send a test push to string, array array(test1, test2)
--event Event name to send the test push to string test
--data Event data to send the test push to string, array test

License

The MIT License (MIT)

Copyright (c) 2016 Martin Aarhof

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


All versions of pusher-bundle with dependencies

PHP Build Version
Package Version
Requires php Version ^5.5.9|^7.0
symfony/http-kernel Version ^2.8|^3.0
symfony/config Version ^2.8|^3.0
symfony/dependency-injection Version ^2.8|^3.0
symfony/event-dispatcher Version ^2.8|^3.0
symfony/console Version ^2.8|^3.0
pusher/pusher-php-server Version ^2.6
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package lsv/pusher-bundle contains the following files

Loading the files please wait ....