且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

整合PHP和asp.net / asp.net MVC的***途径

更新时间:2023-02-16 10:02:07

这真的取决于什么一体化的可接受水平为。您原来的建议,有一些与可维护性的问题,我不会建议他们使用一个面向公众的互联网网站。

It really depends on what an acceptable level of integration is. Your original suggestions have a number of issues with maintainability, and I would not suggest they are used for an public-facing internet site.

如果我有完全控制权,我可能会考虑在PHP站点迁移到IIS和AS​​P.NET部署页面到现场旁边的PHP文件。这取决于如何在PHP站点已建成相当棘手。您可能会遇到的问题,包括成:

If I had full control, I might consider migrating the PHP site to IIS, and deploying ASP.NET pages to the site alongside the PHP files. This can be quite tricky depending on how the PHP site has been built. Problems you might run into including:


  • 在PHP应用程序,无论你在Windows上合适的替代使用mod_rewrite的。这种情况在写作的时候好了很多,但你可能需要调试现有配置。

  • 扩展。都是你需要在Windows上可用的PHP库和扩展的?

  • 性能。有些人反映Windows下的PHP不可接受的性能。我敢肯定,用正确的性能调优你可以到你的旧网站提供等价的东西,如果是这样,甚至一个问题。

在您建议的选项


  • 使用iframe 的。这是可行的,但有点麻烦,它可能会变成是有问题的,如果你需要的东西,如code碱基之间的SSL或JavaScript交互性。

  • 站点之间的
  • 链接的。这是可行的,但也可能有问题,如果SEO对你很重要。有时有远远不止这些,你需要考虑得更多的菜单链接。

  • 使用Web服务来读取ASP.NET页的。这是唯一真正可行的,如果你有一个具有零相互作用或回传很简单的页面。如果您需要处理回发,视图状态等你将有麻烦。使用ASP.NET MVC为您提供了更多的控制和更简单的体验这样合并。我个人的看法是,它是非常哈克,只有东西我愿意为一个单一的页面做(如果它真的很重要)。

  • 使用WSRP(Web服务远程Portlet)的。我不知道这是与常规ASP.NET的选项,我一直以为这是与SharePoint的附加功能。

  • Use IFrame. This is workable but a little clunky, It may turn out to be problematic if you need things like SSL or JavaScript interactivity between the code bases.
  • Link between sites. This is workable, but there could be issues if SEO is important to you. Sometimes there are more links than just menus that you need to consider too.
  • Use web services to read the ASP.NET pages. This is only really feasible if you have very simple pages that have zero interactions or postbacks. If you need to handle postbacks, viewstate etc you are going to be in trouble. Using ASP.NET MVC gives you more control and an easier experience integrating this way. My personal opinion is that it is extremely hacky and only something I would do for a single page (if it was really important).
  • Use WSRP (Web services Remote Portlets). I'm not sure that this is an option with regular ASP.NET, I always thought this was an additional feature with SharePoint.