laupifrpar / lopipusherbundle Goto Github PK
View Code? Open in Web Editor NEWA bundle to use Pusher App
License: MIT License
A bundle to use Pusher App
License: MIT License
in Controller/AuthController.php, line 32
The class
Exception
resolves toLopi\Bundle\PusherBundle\Controller\Exception
in this class namespace. This class doesn't seem to exist in the project class map. Did you forget to add a use statement? Or did you forget to prefix this class with a\
?
* @return Response
*/
public function authAction(Request $request)
{
if (!$this->container->has('lopi_pusher.authenticator')) {
throw new Exception('The authenticator service does not exsit.');
}
$authenticator = $this->container->get('lopi_pusher.authenticator');
$socketId = $request->get('socket_id');
$channelName = $request->get('channel_name');
Posted from SensioLabsInsight
Uncaught ReferenceError: Pusher is not defined websocket:271
(anonymous function)
I'm trying to call your service lopi_pusher.pusher
but I get the exception mentioned in the title.
in my controller:
$pusher = $this->get('lopi_pusher.pusher');
$data['message'] = 'hello from server';
$pusher->trigger('my-channel', 'my-event', $data);
I'm using Symfony 3.4.*
We've used your bundle with our Symfony 2.x project, and now that 2.1 has converted to the use of Composer, I'm trying to work around the lack of a composer.json file.
The official Pusher PHP library is now available via:
https://packagist.org/packages/pusher/pusher-php-server
Would it be possible for this library to be updated to use our library rather than including an old version of our library?
If anything would need to be done to pusher-php-server to make this possible, please let me know. I'm keen to avoid requiring namespaces, but maybe there's a workaround?
https://sonata-project.org/bundles/easy-extends/2-x/doc/reference/why.html
$ ./bin/console sonata:easy-extends:generate -vvv LopiPusherBundle
[2016-12-09 18:24:48] event.DEBUG: Notified event "console.command" to listener "Symfony\Component\HttpKernel\EventListener\DebugHandlersListener::configure".
[2016-12-09 18:24:48] event.DEBUG: Notified event "console.command" to listener "Symfony\Bridge\Monolog\Handler\ConsoleHandler::onCommand".
Lopi\Bundle\PusherBundle\LopiPusherBundle : wrong folder structure
done!
I'm getting this error when trying to install it with composer.
$ composer require laupifrpar/pusher-bundle
Info from https://repo.packagist.org: #StandWithUkraine
Using version ^5.0 for laupifrpar/pusher-bundle
./composer.json has been updated
Running composer update laupifrpar/pusher-bundle
Loading composer repositories with package information
Info from https://repo.packagist.org: #StandWithUkraine
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- laupifrpar/pusher-bundle[5.0.0, ..., 5.0.3] require symfony/config ^3.4|^4.4|^5.0 -> found symfony/config[v3.4.0, ..., v3.4.47, v4.4.0, ..., v4.4.37, v5.0.0, ..., v5.4.3] but the package is fixed to v6.0.3 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
- Root composer.json requires laupifrpar/pusher-bundle ^5.0 -> satisfiable by laupifrpar/pusher-bundle[5.0.0, 5.0.1, 5.0.2, 5.0.3].
Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
You can also try re-running composer require with an explicit version constraint, e.g. "composer require laupifrpar/pusher-bundle:*" to figure out if any version is installable, or "composer require laupifrpar/pusher-bundle:^2.1" if you know which you need.
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
I have created a command php bin/console pusher:test
to trigger the message from the server side but I don't get the message in the client side and I didn't get any exception !
PusherTestCommand
class:
class PusherTestCommand extends ContainerAwareCommand
{
protected function configure()
{
$this
->setName('pusher:test')
->setDescription('...')
->addArgument('argument', InputArgument::OPTIONAL, 'Argument description')
->addOption('option', null, InputOption::VALUE_NONE, 'Option description')
;
}
protected function execute(InputInterface $input, OutputInterface $output)
{
$pusher = $this->getContainer()->get('lopi_pusher.pusher');
$data['message'] = 'hello world';
$pusher->trigger('my-channel', 'my-event', $data);
$output->writeln('Message triggered');
}
}
Can you explain why ?
Hey! I have one simple app and found that this bundle requires twig/twig
But I don't think that it should be directly required. WDYT?
Add support for https://github.com/pusher/pusher-http-php 4.0
Should be rather simple since all they did was dropping support for PHP < 7.1 it seems which is already a requirement here anyways.
in Authenticator/ChannelAuthenticatorPresenceInterface.php, line 24
The class
returns
resolves toLopi\Bundle\PusherBundle\Authenticator\returns
in this class namespace. This class doesn't seem to exist in the project class map. Did you forget to add a use statement? Or did you forget to prefix this class with a\
?
/**
* Return the user id when authenticated, used for presence channels
*
* @returns string
*/
public function getUserId();
}
Posted from SensioLabsInsight
Instead of using the rather limited json_encode()
php function for event data, it would be great if there was an option to use the much more powerful serializer from JMS.
I would suggest a configuration option like:
lopi_pusher:
serializer: jms_serializer
json_encode()
could then be used as a fallback if no serializer is configured.
I am using Laravel Websockets package as a drop in pusher replacement.
I have it working with Laravel, AdonisJS and now I want to make it work with Symfony.
Its quite straightforward usually.
needs:
custom host
custom port
encrypted flag (which I guess is the SCHEME).
My pusher_php_server.yaml is:
services:
Pusher\Pusher:
public: true
arguments:
- '%env(PUSHER_KEY)%'
- '%env(PUSHER_SECRET)%'
- '%env(PUSHER_APP_ID)%'
- { cluster: '%env(PUSHER_CLUSTER)%',host: '%env(PUSHER_HOST)%' }
lopi_pusher:
timeout: '%env(PUSHER_TIMEOUT)%'
debug: '%env(bool:PUSHER_DEBUG)%'
scheme: '%env(PUSHER_SCHEME)%'
port: '%env(PUSHER_PORT)%'
host: '%env(PUSHER_HOST)%'
app_id: '%env(PUSHER_APP_ID)%'
key: '%env(PUSHER_KEY)%'
secret: '%env(PUSHER_SECRET)%'
cluster: '%env(PUSHER_CLUSTER)%'
auth_service_id: my_channel_authenticator
I have similar data in lopi_pusher.yaml
But it still tries to use:
ws://ws-eu.pusher.com/app/channel?protocol=7&client=js&version=4.2.2&flash=false
Why does it ignore host?
Yes, I have all those values in .env
Would be really helpfull if you would use the Pusher PHP lib (https://github.com/squeeks/Pusher-PHP) because it has way more features. For example, support for presence_auth.
I could make a PR if you'll merge it? Otherwise I'll make my own Symfony2 bundle based on Pusher PHP.
Using the "Twig_Extension_GlobalsInterface" class is deprecated since Twig version 2.7, use "Twig\Extension\GlobalsInterface" instead.
/usr/src/app/vendor/laupifrpar/pusher-bundle/Twig/PusherExtension.php:15 {▼
› */
› class PusherExtension extends \Twig_Extension implements \Twig_Extension_GlobalsInterface
› {
}
Would be neat if that could be updated :)
Getting following error while clearing the cache in symfony 2.7.26
[Symfony\Component\Config\Definition\Exception\InvalidConfigurationException] Unrecognized options "scheme, cluster, url" under "lopi_pusher"
Hi,
if I install only your pusher bundle it will by default install the new 3.0 version of pusher-http-php.
The problem with that is that they changed the namespace around in that version which breaks everything.
A temporary fix is to manually include the version 2.6.4 in my composer.json file but it would be good if you either changed the bundle to work with the new namespace or set it up so that it doesn't use the 3.0 version on a new installation.
Best regards
Semicolon missing in AuthController at line 38
how i save the messages on my database?, for after searchable
When bundle configured with only url parameter, other parameters (key, secret, app_id) are not defined here:
and AuthController doesn't work.
Symfony 7 has been out for a while now.
Will the maintainer be upgrading this on his own or is a PR acceptable?
Hi,
now this bundle supports only the pusher-cluster "us-east-1". There are are two more clusters (eu and asia): https://pusher.com/docs/clusters#/lang=php
It would be great, if this bundle would support that.
Greetings!
I am currently using webhooks for all client events for a specific feature on a site. I don't want webhooks triggering for client events in other features so I am separating these site features using pusher apps.
Unfortunately this means I need to use pusher in symfony with different app credentials depending on which actions are being called. What is the best way to do this considering right now you can only really pass the bundle a single set of credentials?
The main trigger request adds double slashes between host and path:
https://github.com/laupiFrpar/LopiPusherBundle/blob/master/Pusher/Pusher.php#L54
Resulting in something like:
http://http://api.pusherapp.com//aps/12345/...
This works fine most of the time, but Pusher recently blocks some of those requests due to proxy configuration on their end. This has been confirmed by Pusher support. They can't guarantee that requests with double slashes will continue to work.
This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.
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.
Posted from SensioLabsInsight
I got this error:
Invalid configuration for path "lopi_pusher": Either url or app_id, key and secret needs to be set.
With this pusher_php_server.yaml:
services:
Pusher\Pusher:
public: true
arguments:
- '%env(PUSHER_KEY)%'
- '%env(PUSHER_SECRET)%'
- '%env(PUSHER_APP_ID)%'
And these variables defined on .env as PUSHER_HOST=api-eu.pusher.com etc ...
Also I'd need to config:
timeout: '%env(PUSHER_TIMEOUT)%'
debug: '%env(PUSHER_DEBUG)%'
scheme: '%env(PUSHER_SCHEME)%'
port: '%env(PUSHER_PORT)%'
host: '%env(PUSHER_HOST)%'
cluster: '%env(PUSHER_CLUSTER)%'
auth_service_id: my_channel_authenticator
But don't know where...
Thanks!
The variable $responseData
does not seem to be defined for all execution paths leading up to this point.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.