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.
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).
发布评论
评论(5)
jsc 项目可以为您将 .net/C# 转换为 PHP。
The jsc project can convert .net/C# to PHP for you.
我知道您希望有人有经验,但万一没有人挺身而出...
您可能会考虑将代码复制并粘贴到 PHP 脚本中,然后检查有什么问题。 编写一个解析器来解决这个问题,在整个脚本中运行它,然后看看接下来会出现什么问题。 继续,直到脚本按预期运行。
如果您不使用任何更复杂的 .Net 类,我无法想象您会遇到太多麻烦。
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.
有一个刚刚启动的项目cs2php。 来源可在 https://github.com/isukces/cs2php 上获取,主页为 http://www.cs2php.com/ 。
There is just started project cs2php. Sources are available on https://github.com/isukces/cs2php and homepage is http://www.cs2php.com/ .
您是否需要一个将 C# 代码直接转换为 PHP 的工具? 我怀疑是否有可用的,而且我对使用它有点担心(根据我对 C# 的了解,它不容易转移到 PHP)。
根据项目的规模,我更倾向于重写它。 我确实看了一下,但找不到任何东西(尽管有很多很多的工作请求 - 看起来像是那里的企业=P)。
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).
您现在可以使用 phalanger.codeplex.com 在 .NET 上运行 PHP 代码,调用您的业务类
You can now run your PHP code on .NET calling into your business clases using phalanger.codeplex.com