Skip to main content
gamedev.net
🔒 Locked

[web] Ruby-PHP Integration

Started by Andrew Russell Aug 10, 2007 at 10:13 PM 2 replies 2.5k views
Original Post
Andrew Russell
Andrew Russell
Simple question: Say I have some Ruby on Rails app, which handles various things for a website including user account management, and I want to integrate some piece of PHP software (anything, say MediaWiki or WordPress) into that same website: Is it possible? Is it sensible? How would one go about doing it? Edit: I'm also interested in the same question for Python (probably TurboGears) + PHP. Thoughts?
Mathachew
Mathachew
At my previous job, we would execute Python scripts via command line in PHP using exec(), system() or passthru(), whichever is your preference. What we normally did was create the command to execute with any parameters, placed it in a variable, and then passed it to one of the PHP functions. I'm not sure how this would work on a Windows system running PHP since we used Linux, but you're probably running a *nix based system anyways.

I'm not sure about RoR and PHP though. I'd imagine most CMS' would use session variables, and as such, I don't think that info can be passed from one language to another. You'd probably have to use something like cURL or even GET.

[Edited by - Mathachew on August 11, 2007 4:17:48 PM]
Andrew Russell
Andrew Russell
My research so far indicates that you need to setup a session database to do such a thing, and share it between Ruby and PHP.
Mathachew
Mathachew
That sounds possible. I wouldn't consider it ideal, but for wanting to communicate between two server side languages in this manner, that definitely sounds like a doable solution.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.