Answer the question
In order to leave comments, you need to log in
php-to-rails bridge. Or a socket. Or at least something?
Imagine an ordinary WordPress site with all its advantages and disadvantages. Tied to its usual WordPress base. And on the same server, the rails application is running with its own separate database. Is there any not too obscure way to make a request from the php project code and get a response from the rails application? Can a socket what to adjust? Preferably not with curl-http-json. Or at least tell me which way to dig. Thank you.
Answer the question
In order to leave comments, you need to log in
It will connect to this very “separate” database on which the Rails application is tied and get data from it using PHP.
stackoverflow.com/questions/3175597/communication-passing-info-between-php-app-and-ruby-app - found something in the topic, but maybe someone still tried it?
If you need bare data from the database, connect directly to the database.
If you need data that only a Rails application can give, you can run it through the console. I don’t write in RoR, but I’m sure that they easily create commands there to run from the console. Let the command output JSON, and you parse it in PHP. To run console commands there is www.php.net/manual/en/function.exec.php .
But, by the way, right now you have both applications on the same server, and if one day something changes, then the implementation on cURL and basic HTTP authentication would continue to work, but the option with commands would not.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question