Rails and PHP

Can anyone tell me how one might go about integrating Rails with a PHP app.
The main site itself is in PHP. The way things would work is most of the static content will be handed off in PHP,
and the dynamic content will be Rails.

S

Dark Ambient wrote:

Can anyone tell me how one might go about integrating Rails with a PHP app.
The main site itself is in PHP. The way things would work is most of
the static content will be handed off in PHP,
and the dynamic content will be Rails.

S

--
http://en.wikipedia.org/wiki/Dark_ambient
>

you can proxy PHP pages through Rails, examples exists on rails wiki
page and there is also simple code snipet on:

http://www.bigbold.com/snippets/posts/show/197

hope it helps,
Bojan

Can anyone tell me how one might go about integrating Rails with a PHP app.
The main site itself is in PHP. The way things would work is most of the
static content will be handed off in PHP,
and the dynamic content will be Rails.

http://rubyforge.org/pipermail/mongrel-users/2006-August/001300.html

Defintely helps, or at least seems the most feasible at this point. I found these two links on wiki:

http://wiki.rubyonrails.com/rails/pages/HowToRenderProxiedPages
and
this one, though the author doesn’t seem in favor of proxying

http://wiki.rubyonrails.com/rails/pages/Integrate+Rails+with+a+CMS

Are there performance issues.
I’m wondering if the two apps can be managed seperately. Basically Rails will come into play when a table or query is needed.
At that point PHP will send the header and footer of the template and Rails would deliver the partial , but maybe I’m dreaming.

Stuart

Matthew that sounds like a good approach. Any performance or security issues ? I found the XML-RPC page, so I’ll be reading up.
And I’m assuming (since this is the first time I’m hearing) web services scaffoling is part of Rails 1.1.6 ?

Stuart

Stuart Fellowes wrote:

Matthew that sounds like a good approach. Any performance or security
issues ? I found the XML-RPC page, so I’ll be reading up.
And I’m assuming (since this is the first time I’m hearing) web services

scaffoling is part of Rails 1.1.6 ?

We don’t have a high traffic website, so performance isn’t an issue. If
it were, I’d probably implement some caching on the PHP side.

I can’t think of any possible security issues. There is nothing

available through XML-RPC that isn’t public anyway. You write special
web services “models” (ActionWebService::Struct) which contain just
enough information for the XML-RPC client.

Just to confirm then, the XML-RPC client would be the PHP (in my case) application ?

Stuart

Stuart Fellowes wrote:

Matthew that sounds like a good approach. Any performance or security
issues ? I found the XML-RPC page, so I’ll be reading up.
And I’m assuming (since this is the first time I’m hearing) web services

scaffoling is part of Rails 1.1.6 ?

We don’t have a high traffic website, so performance isn’t an issue. If
it were, I’d probably implement some caching on the PHP side.

I can’t think of any possible security issues. There is nothing

available through XML-RPC that isn’t public anyway. You write special
web services “models” (ActionWebService::Struct) which contain just
enough information for the XML-RPC client.

Just to confirm then, the XML-RPC client would be the PHP (in my case) application ?

Another question - instead of using XML-RPC , can I use REST ?

Stuart

Looking at this article http://www-128.ibm.com/developerworks/java/library/j-cb08016/index.html
it appears that the client makes the request “show me some data” and sends it into Rails.
And then the data might be sent back in html, xml , etc but the client is rendering that data itself
However I think the way it should work for me is the client makes the request and Rails takes control of the output at that point.

I’m thinking that’s reasonable.
So at a deeper level, if the a user enters a query on the PHP client, PHP must send back an array or hash of the query options ?

Stuart