2

I saw a lot of interesting libraries in Ruby that don't exist for PHP or its equivalents, so I want know if there is a library interpreter or something that can use RUBY code inside PHP programs to call methods and pass variables.

thx

Andy
  • 1,480
  • 14
  • 17
nonyck
  • 31
  • 1
  • welcome to stackoverflow. I wanted to invite you to read the [FAQ](http://stackoverflow.com/faq) so that you know how to ask and answer questions (this also is a reaction to your answer to [this question](http://stackoverflow.com/q/1030736/468327)). Further please respect our community by using good spelling and grammar and people will be happy to help you. – Joel Berger Jul 21 '11 at 22:07

2 Answers2

2

There is no way that I know of to, say, write a PHP wrapper for a Ruby class.

You can, however, write a standalone Ruby script and then call it with a system command.

Matchu
  • 83,922
  • 18
  • 153
  • 160
0

You could run a Ruby daemon or background worker of some kind and connect it with something like RabbitMQ.

But Matchu's suggestion of a script should be good enough. Ruby starts quickly. A good server can start Ruby from scratch and run a trivial Ruby script almost 500 times / second / core. Even a bad server can do 50 / second.

Community
  • 1
  • 1
DigitalRoss
  • 143,651
  • 25
  • 248
  • 329