|
I'm trying to implement a web socket with PUSHER within an existing cakephp 2.2.1 application. Has anyone attempted anything similar or come across any resources that define what is required, how this can be achieved?
--
You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [hidden email]. To unsubscribe from this group, send email to [hidden email]. Visit this group at http://groups.google.com/group/cake-php?hl=en-US. |
|
Yeah, it's quite simple. You just import the pusher app as a vendor, or require it which I believe is what the proper way of doing it in 2.2.1 is.
Like this, just put the Pusher.php file they provide in your Vendors folder of your app. require_once(APP . DS . 'Vendor' . DS . 'Pusher.php'); $pusher = new Pusher('','','');//Your api keys, and stuff go here Then you can just do $pusher->trigger('channel','event',arrayofdata); And you're good to go. On Tuesday, August 14, 2012 7:05:10 AM UTC-7, Nick Crane wrote: I'm trying to implement a web socket with PUSHER within an existing cakephp 2.2.1 application. Has anyone attempted anything similar or come across any resources that define what is required, how this can be achieved?-- You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [hidden email]. To unsubscribe from this group, send email to [hidden email]. Visit this group at http://groups.google.com/group/cake-php?hl=en-US. |
|
In reply to this post by Nick Crane
Thanks for the info, I hope it's that simple, I'll give it a go and update the post.
Thanks again.
-- On Tuesday, 14 August 2012 15:05:10 UTC+1, Nick Crane wrote: I'm trying to implement a web socket with PUSHER within an existing cakephp 2.2.1 application. Has anyone attempted anything similar or come across any resources that define what is required, how this can be achieved? You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [hidden email]. To unsubscribe from this group, send email to [hidden email]. Visit this group at http://groups.google.com/group/cake-php?hl=en-US. |
|
In reply to this post by Nick Crane
OK, I'm still struggling, anyone with a working example of a real-time activity stream that updates the results in a view after a record is save.
On Tuesday, 14 August 2012 15:05:10 UTC+1, Nick Crane wrote: I'm trying to implement a web socket with PUSHER within an existing cakephp 2.2.1 application. Has anyone attempted anything similar or come across any resources that define what is required, how this can be achieved? You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [hidden email]. To unsubscribe from this group, send email to [hidden email]. Visit this group at http://groups.google.com/group/cake-php?hl=en-US. |
|
In reply to this post by Nick Crane
OK, got it working with the pusher "Event Creator" fine, but when it came to including the
$pusher->trigger('channel','
Tried it with pubnub, a very similar implementation, it works fine. If anyone is that interested i can post a more detailed explanation.
-- On Tuesday, 14 August 2012 15:05:10 UTC+1, Nick Crane wrote: I'm trying to implement a web socket with PUSHER within an existing cakephp 2.2.1 application. Has anyone attempted anything similar or come across any resources that define what is required, how this can be achieved? You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [hidden email]. To unsubscribe from this group, send email to [hidden email]. Visit this group at http://groups.google.com/group/cake-php?hl=en-US. |
-- You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [hidden email]. To unsubscribe from this group, send email to [hidden email]. Visit this group at http://groups.google.com/group/cake-php?hl=en-US. |
|
In reply to this post by Nick Crane
I'm not sure why you are having issues, I would show you an example but I already showed you my example.
Literally just create a new Pusher object with your secret keys and such and you can trigger any channel with any event with any data. Is there any issue with your javascript, and you can't really test this on localhost without some setup. So I'm just curious what exactly was the error that you were getting. On Friday, August 17, 2012 8:46:00 AM UTC-7, Nick Crane wrote: OK, got it working with the pusher "Event Creator" fine, but when it came to including the $pusher->trigger('channel','-- You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [hidden email]. To unsubscribe from this group, send email to [hidden email]. Visit this group at http://groups.google.com/group/cake-php?hl=en-US. |
|
Thankyou @thatsgreat2345, it works well !!
On Monday, August 20, 2012 1:15:45 AM UTC+5:30, thatsgreat2345 wrote: I'm not sure why you are having issues, I would show you an example but I already showed you my example.-- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [hidden email]. To unsubscribe from this group, send email to [hidden email]. Visit this group at http://groups.google.com/group/cake-php?hl=en. |
| Powered by Nabble | Edit this page |
