Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way install Ratchet without composer?

I have an app that is poorly written is php "spaghetti code"

I need to implement a web-socket where I can use PHP to make calls to an API.

I tried to use Node.js but the problem is that there is many things that I need to check for using php.

  1. "User must be logged in" I need to check for an active session in my app. Aka "authenticate the user."
  2. Read the API credentials from the user database from my app after the user have been authenticated.
  3. Finally, generate a client script that will ping an API every 1 second to check for new messages.

I thought it will be easier if I have a PHP websocket setup instead of node.js where step 1 and 2 already handled by my APP and all I will is just to write a client code that will communicate with the websocket to retrieve the new messages.

It sound like Ratchet is a good way to go but not sure how to install it in my APP using the composer if my APP does not have a setup to use composer or autoloaders.

While I am working on a project to convert my app to Laravel 5.1, I am in an immediate need to implement the websocket to reduce the amount of the TCP connections that are sent to to my server.

How can I install Ratchet? is there alternative package I can use rather than using Ratchet if I Can't install it in my current environment?

like image 686
Junior Avatar asked Oct 19 '22 04:10

Junior


1 Answers

Lol, user asks what a word means. Community responds by using that word in the definition....

I think the OP was looking for an alternative autoloader, or perhaps help with loading the files manually.

like image 124
user3067533 Avatar answered Oct 22 '22 00:10

user3067533