集成Zend Framework和WordPress,委派页面加载 [英] Integrating Zend Framework and WordPress, Delegating page loads

查看:124
本文介绍了集成Zend Framework和WordPress,委派页面加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要在 Zend Framework WordPress 之间进行完全集成。为了说明起见,这并不意味着我想在 WordPress 中使用 Zend库,而是在两个系统之间委派单个网站的网页加载。

I'm looking to have a full integration between Zend Framework and WordPress. For clarification, this does not mean I want to use Zend Libraries within WordPress, but rather delegating the page loads for a single site between both systems.

我做了相当多的研究,我遇到了几个项目,但没有什么比我想要的东西。我想要从 MVC (如果有的话)加载网页,否则请从 WordPress (或反之亦然)加载。

I've done a fair bit of research, I've come across several items, but nothing quite like what I'm looking for. I want to be able to load a page from the MVC if it exists and is available, otherwise load from WordPress or vice versa.

现在,我想我可以用 WordPress Zend Framework的 index 。这样做,我需要有一个类型的检查对输入的请求,以决定要打哪个系统。我想我会在缓存中有一个东西,包含所有 Wordpress uri的来检查(将通过<$ c $更新c> cron job / 守护程序),如果没有,请提供 bootstrap strong> Zend Framework 。

Now, I think I could approach this in a manner of combining the index files of WordPress and Zend Framework. Doing so, I would need to have a type of "check" against the incoming requests to decide which system to hit. I would suppose I would have a something in cache, containing all the Wordpress uri's to check against (that would be updated through a cron job / daemon), if not, serve up the bootstrap from Zend Framework.

任何建议都将非常感激。

Any suggestions would be greatly appreciated.

推荐答案

如果你想要做的是在ZF网站上有一个Wordpress博客,那么只需把博客放在一个子域或使用mod_rewrite重写所有请求 blog / 到Wordpress。

If all you're trying to do is have a Wordpress blog on a ZF site, then just put the blog on a subdomain or use mod_rewrite to rewrite all requests to blog/ to Wordpress.

如果你想做一些更复杂,需要两个系统之间的交互,我建议你路由所有请求到ZF (使用标准重写规则)。然后让ZF决定是否可以处理请求,如果没有,包括Wordpress index.php,让Wordpress做它的事情。有关详情,请参阅此处的答案:将Brownfield PHP Webapp转换为Zend框架

If you're trying to do something more complicated that requires interaction between the two systems, I would suggest you route all requests to ZF (using the standard rewrite rules). Then let ZF decide whether or not it can handle the request, and if not, include the Wordpress index.php and let Wordpress do it's thing. See the answer here for some more detail: Converting a Brownfield PHP Webapp to Zend Framework.

您希望避免对Wordpress本身进行任何更改,否则升级WP将成为一个痛苦的过程。

You want to avoid making any changes to Wordpress itself if at all possible, as otherwise upgrading WP will become a painful process.

这篇关于集成Zend Framework和WordPress,委派页面加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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