How do I make variables in PHP and pass them to Ruby? -


i have script running in ruby, , in php, and, needs it's not possible make run in same scripting language.

i want use php create variable in ruby. currently, have code:

php:

$config = fopen("config.txt","w+"); fwrite($config,$sarguments); fclose($config); 

ruby:

while true file = file.new("config.txt", "r") config = file.gets file.close end 

the php write next configuration in file , ruby read , turn variable. works, ruby has work on reading , reading file, , fail read correct, code badly optimized.

is there faster way pass information php script ruby script?

i'm no expert in php think "how run ruby code python (python-ruby bridge)" provides ways of how accomplish communication between 2 languages. although page speaks of ruby-python communication, i'm pretty sure of suggestions can implemented ruby , php.

one solution use xml-rpc transfer simple data types php ruby. ruby has native support xml-rpc , think there libraries php enable support xml-rpc.

you can use pipes. is, call php script via ruby's io.popen. i've done similar ruby-python in "feasibility of using pipe ruby-python communication" have not evaluated performance.


Comments

Popular posts from this blog

Hatching array of circles in AutoCAD using c# -

ios - UITEXTFIELD InputView Uipicker not working in swift -

Python Pig Latin Translator -