如何将Wordpress与CodeIgniter集成? [英] How Can I integrate Wordpress with CodeIgniter?

查看:201
本文介绍了如何将Wordpress与CodeIgniter集成?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将WordPress函数与php一起使用,但遇到了一些麻烦..

I'm trying to use WordPress functions with php, and i'm having some troubles..

错误消息显示: 在第287行的/hd2/www/WWW_BACKUP/www-lalala/blog/wp-settings.php中调用未定义的方法stdClass :: set_prefix()

the error message says: Call to undefined method stdClass::set_prefix() in /hd2/www/WWW_BACKUP/www-lalala/blog/wp-settings.php on line 287

推荐答案

我不确定您为什么要集成这两者,因为Wordpress不是开发框架.我正在做一个 BIG 假设,您真的要把它放在相同的目录"中并能够使用相同的数据库吗?

I'm not sure why you would want to integrate the two, as Wordpress is not a development framework. I am making a BIG assumption that you really want to just have it in the same 'directory' and be able to utilize the same database?

我以前见过,并且只需要共享数据库的配置文件(包括codeigniter中的wordpress config等).

I've seen that done before, and it involves simply sharing config files for your database (include wordpress config inside codeigniter, etc).

只需将CI放在Wordpress目录内的文件夹中即可:

Just stick CI inside a folder inside your Wordpress directory:

/website/
  /ci/ (codeigniter runs inside here)
  /wp-content/
  /wp...
  ...
  index.php (wordpress)
  .htaccess (combined wordpress / ci functionality)

然后,您只需将 duck 放入/ci文件夹中以获取CI功能,然后重定向到Wordpress.

Then you would just duck inside the /ci folder for CI functionality and redirect back to Wordpress after.

至于与CODE的合并(即,在其中运行CI的wordpress或反之亦然)进行集成,这毫无意义,而且大多数人都在浪费时间.

As far as integrating with merge of CODE (ie, wordpress with CI running inside of it or vice versa) that is pointless and most would argue a waste of time.

Wordpress已经提供了您希望在CI中构建的大多数功能(会话跟踪/数据库活动查询/基本CRUD功能/用户管理).

Wordpress already offers most of the features you would want to build in CI (session tracking / database active querying / basic CRUD functionality / user management).

如果您寻求的只是利用在CI中获得的Wordpress中的一些小功能",那么我想说的是仅专注于 porting .

If all you seek is to utilize some small 'functions' in Wordpress that you get in CI, I would say focus on porting those alone.

像这样将两个应用程序合并在一起不会有什么好处.

Nothing good can come of you merging two applications together like this.

这篇关于如何将Wordpress与CodeIgniter集成?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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