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 A. 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


Dark ambient - Wikipedia

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

hope it helps,
Bojan


Bojan M.
Informatika Mihelac, Bojan M. s.p. | www.informatikamihelac.com
→ tools, scripts, tricks from our code lab: http://source.mihelac.org

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

Stuart Fellowes 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.

We currently pull a fair amount of content for our main website (PHP)
out of an internal Rails application using XML-RPC. Easy to setup and
test using the webservices scaffolding. Works pretty good.

-matthew

On 11/7/06, Matthew I. [email protected] wrote:

We currently pull a fair amount of content for our main website (PHP)
out of an internal Rails application using XML-RPC. Easy to setup and
test using the webservices scaffolding. Works pretty good.

-matthew

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

On 11/7/06, Bojan M. [email protected] wrote:

Bojan
Defintely helps, or at least seems the most feasible at this point. I
found
these two links on wiki:
Peak Obsession
and
this one, though the author doesn’t seem in favor of proxying
Peak Obsession

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

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. So nothing in your app is
directly exposed to the web.

Web services are standard part of 1.1.6, but I hear they are moving it
out to its own plugin. Maybe in 1.2?

Scaffolding just means that you can put a line like this at the top of
the controller:

web_service_scaffold :invoke

That gives you are URL like: http://yoursite.com/remote/posts/invoke/api
where you can manually enter SOAP/XML-RPC requests to test the results
before you try to get the PHP to work with it.

-matthew

On 11/7/06, Matthew I. [email protected] wrote:

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

So nothing in your app is

That gives you are URL like: http://yoursite.com/remote/posts/invoke/api
where you can manually enter SOAP/XML-RPC requests to test the results
before you try to get the PHP to work with it.

-matthew


Posted via http://www.ruby-forum.com/.

On 11/8/06, Dark A. [email protected] wrote:

scaffoling is part of Rails 1.1.6 ?
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

Stuart

web_service_scaffold :invoke


Dark ambient - Wikipedia

On 11/8/06, Matthew I. [email protected] wrote:

-matthew

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

Stuart Fellowes wrote:

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

Sure. Never used it though.

And yes, the XML-RPC client would be the PHP.

-matthew