整合PHP和asp.net / asp.net MVC的最佳途径 [英] Best way to integrate PHP with asp.net / asp.net-mvc

查看:108
本文介绍了整合PHP和asp.net / asp.net MVC的最佳途径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据一些巧合,这一问题上来两次在上周。

By some coincidence this problem has come up twice in the last week.

一个客户有他们想保持现有的PHP网站。他们也已经或将很快有一些ASP.net的网页,他们希望融入现有的网站,因为它显示为一个单一的网站的方式。

A customer has an existing PHP web site which they want to keep. They also have or will soon have some ASP.net web pages that they wish to integrate into the existing site, in a way that it appears as a single site.

我们虽然拥有的下列可能性:

We have though of the following possibilities:


  • 使用的IFrame

  • 所有的HTML /菜单复制到新的网站和网站之间的链接,网站之间的用户移动,但没有注意到,如果他不看网址

  • 使用Web服务从asp.net网站读取信息,并写在PHP网站的HTML。

  • 使用WSRP(Web服务远程Portlet)。已经测试这在Java站点上显示的Sharepoint的WebParts,都没有用PHP进行测试。

有没有人尝试过​​这些?有一个更好的建议?有没有什么我们应该避免definatly?

Has anyone tried any of these? Has a better suggestion? Is there any we should definatly avoid?

感谢

设拉子

推荐答案

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

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.

这篇关于整合PHP和asp.net / asp.net MVC的最佳途径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆