= Ruby -> PHP Bridge
The Ruby PHP bridge is a tiny library providing a JSON bridge
between the two languages. Any code which can be converted to JSON
can be passed between the two. In both cases the '$return' variable
may be set in order to convert it to the other language.
PHP::Bridge.eval '$return = array("any", "data", "here");'
=> ['any', 'data', 'here']
OR
require 'ruby-php-bridge/import'
php '$return = array("something")'
=> ['something']
OR
require 'ruby-php-bridge/import'
php 'array("something")'
=> ['something']
OR
bridge = PHP::Bridge.new
bridge << '$a = "hello";'
bridge << '$a .= " there";'
bridge << '$return = $a;'
bridge.eval
=> ['hello there']
As you can see in one of the examples above, '$return =' is prepended
when not present, providing a cleaner API.
== PHP -> Ruby Bridge
A small PHP library functions similarily, providing
a bridge to Ruby, which is located in php/php-ruby-bridge.php
ruby('$return = ["any", "data", "here"]')
// => array('any', 'data', 'here')
== License:
(The MIT License)
Copyright (c) 2009 TJ Holowaychuk tj@vision-media.ca
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, an d/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.