简体   繁体   中英

PHP to ASP.Net 4.0

I am looking for a tool that can convert a PHP application into ASP.Net application either c# or VB.Net. I tried using the 'PHP to ASP.NET Migration Assistant' from microsoft but it leaves a lot of code un coverted and doesn't even create proper codebehind files. Any ideas or tools that you know?

It's not going to work, sorry. Not only are the languages very different (the biggest difference arguably being that one is dynamically typed and the other is statically typed), but the entire architecture of the environment is vastly different. No automated tool is going to overcome this.

Even if you can find a tool that claims to accomplish this, it's going to emit terrible .NET code. It probably won't use any of the server controls, or at least not use any of them correctly. It's going to force the .NET code to try to do things "the PHP way" and end up costing you a ton in performance and maintainability.

Basically, there's just no way, reasonable or otherwise, to do what you're trying to do. Think of it this way... Have you ever seen automated translations between vastly different spoken languages? The results are humorous to say the least, and they are not accurate representations of the target language.

You're going to need a developer (or team of developers) to do this.

I don't think you can convert automatically a full php application into dotnet, as SLaks said, these languages are very different.

I started dotnet a half year ago, after years in php, and it's really different. You cannot use common techs from php, but you can use anothers. It's a different approach with different advantages, so an automatic tool can't do this.

Maybe you can convert some general php structures with a tool, but it won't be as good as if you write it by hand. And a complete app is nearly impossible.

For example, how would you convert a native php template based view system automatically? Maybe you can achieve this (never say impossible), but you shouldn't waste your time.

You can finish it much faster by hand than searching for a probably non-existent (or not good enough) tool.

As others have stated, an automatic converter from php to c#/asp.net is going to leave a lot to be desired.

Your question got me thinking (well, googling) about php on .net. My search found this: Welcome to Phalanger 2.x .

I don't know how mature it is (though being at 2.x implies some level of maturity); but I'm thinking that with something like this you can port your code over time , while still having the app up and running and still making incremental improvements to the application.

您现在可以使用http://phalanger.codeplex.com通过互操作在.NET上运行PHP了!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM