title: Port a Ruby/Rails application to PHP 5
body: <p>I have a very large Ruby on Rails application that I would like to port to PHP 5.2 or maybe PHP 5.3 (if 5.3 ever gets released).</p>
  
  <p>I've been looking for a some way of automatically converting the simple stuff like simple classes and the ERB templates. I would expect that I'd have to do the more complicated stuff myself in cases where the languages are just too dissimilar.</p>
  
  <p>Can anyone suggest an approach for doing this? Or a script that can automate some of it?</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>There is a business case for doing this. Whether it is a sound business case is another issue which I don't care to discuss here. We have a framework that is similar enough to Rails - the real issue is conversion from Ruby to PHP rather than Rails to PHP. I'm not really looking for something that will magically do all the work, just something simple that will give a headstart. Even if all it did was change:</p>
  
  <pre><code>def somemethod somearg
    some.ruby.code
  end
  </code></pre>
  
  <p>to:</p>
  
  <pre><code>public function somemethod($somearg) {
    // some.ruby.code
  }
  </code></pre>
  
  <p>and left the innards as ruby in php comments that would still make the job easier.</p>
  
  <p>Ideally there would be something out there that does this or similar already. Otherwise I might have to the write tool myself.</p>