Hi all, This might sound weird!!! If I want to include/execute simple "helloworld" inside my rails application (actually I want to integrate some php applications...) what need to be done. If I am not wrong this is possible and could anyone please give me more info on this or redirect to already available examples... Thanks, Sumanth. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
You could use the php command line: test.php: print "Hello, world!; test.rb php_output = `php test.php` Or just to exec and directly output use: system "php test.php" Ofcourse, php cli must be available. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Wouter De bie wrote:> You could use the php command line: > > test.php: > print "Hello, world!; > > > test.rb > php_output = `php test.php` > > > Or just to exec and directly output use: system "php test.php" > > Ofcourse, php cli must be available.Hi Wouter, Thanks for your reply. What I am looking is how to execute these php files in rails application (project). Precisely, where to keep the php files, how to execute these php files from rails controllers, and what to do to integrate the php application databases.... Thanks, Suamnth Krishna.A -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
OK I''m not even going to ask why you would want to do that, but you can keep your files wherever you like, and just execute them as scripts. But they won''t work in that same way ruby scripts do with other ruby scripts, you can use functions written in PHP and call them directly in Ruby, you''d need to execute an entire script. If you don''t mind me asking, why the heck would you want to do this??? If you have some massive legacy app or something, I can''t imagine why you''d be porting "bits" of it to rails. You could also always write a web sevice with SOAP or XML or something and connect to that with Ruby and then use that... Long and the short of it, you can call any php script with something like: exec ''php filename.php'' Cam On Jul 16, 3:23 pm, Sumanth Ambati <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Wouter De bie wrote: > > You could use the php command line: > > > test.php: > > print "Hello, world!; > > > test.rb > > php_output = `php test.php` > > > Or just to exec and directly output use: system "php test.php" > > > Ofcourse, php cli must be available. > > Hi Wouter, > Thanks for your reply. What I am looking is how to execute these php > files in rails application (project). Precisely, where to keep the php > files, how to execute these php files from rails controllers, and what > to do to integrate the php application databases.... > > Thanks, > Suamnth Krishna.A > > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---