Junior
Junior

Reputation: 11990

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?

Upvotes: 5

Views: 3407

Answers (1)

Supun Kavinda
Supun Kavinda

Reputation: 1483

You might check this out to install Ratchet without composer.

Upvotes: 1

Related Questions