I have a very large Ruby on Rails application that I would like to port to PHP 5.2 or possibly PHP 5.3 (if 5.3 is ever released).
I was looking for a way to automatically convert simple things like simple classes and ERB templates. I would expect that I would have to do more complex things when the languages are just too different.
Can anyone suggest an approach for this? Or a script that can automate some of them?
EDIT:
There is a business affair for this. Whether this is a valid business case is another issue that I do not want to talk about here. We have a structure that is quite similar to Rails - the real problem is the conversion from Ruby to PHP, not Rails to PHP. I'm not really looking for something that will magically do all the work, just something simple that will give a hat. Even if all this has been done, this change:
def somemethod somearg
some.ruby.code
end
in
public function somemethod($somearg) {
}
and left the insides as ruby in the php comments, which would make things easier anyway.
Ideally, there would be something that already does this or the like. Otherwise, I may need the recording tool itself.
source
share