Question

I have a business logic classes that are written in pure C# (without any specific things from this language) and I would convert this code into PHP. I can write my own parser, but think if I could someone did it before me.

Could you please tell me where can I find this kind of converter?

Ps. As I've written I use only plain C# programming in this language. Only arguments, declarations of variables, equations and control statements.

Was it helpful?

Solution

I know you're hoping for someone who had experience but in case no one comes forward...

You might consider just copy and pasting the code into a PHP script and checking what breaks. Write a parser to fix that, run it across the entire script, and see what's the next thing that breaks. Continue until the script functions as expected.

If you're not using any of the more involved .Net classes I can't imagine you'll have too much trouble.

OTHER TIPS

There is just started project cs2php. Sources are available on https://github.com/isukces/cs2php and homepage is http://www.cs2php.com/ .

Are you asking for a tool to directly convert your C# code to PHP? I doubt there is one available and I'd be a little worried about using one (from what I've learnt of C# it's not easily transferrable to PHP).

Depending on the size of the project I'd be much more inclined to rewrite it. I did have a look but couldn't find anything (lots and lots of job requests though - looks like a business there =P).

You can now run your PHP code on .NET calling into your business clases using phalanger.codeplex.com

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top