Codeigniter + PhpBB函数重新声明 [英] Codeigniter+PhpBB function redeclaration

本文介绍了Codeigniter + PhpBB函数重新声明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!



I am trying to integrate phpbb to codeigniter. I don't want that the users register for the forum. Site login/register controllers should handle the forum part as well, so I am writing a ci library to register/login to phpbb.


I got an error because I have included phpbb functions and libraries inside my ci library:

中声明E: \\ xampp \htdocs\ci\system\helpers\url_helper.php:535)in

Fatal error: Cannot redeclare redirect() (previously declared in E:\xampp\htdocs\ci\system\helpers\url_helper.php:535) in


Any idea how to solve this quickest way?


phpbb files that I have included inside my ci library are:

    < .php
  • 包含/ functions_user.php

  • 包含/ functions_modul.php


我会做的只是将PHPBB文件复制到CI application / 目录, /

What I would do is just copy the PHPBB files to the CI application/ directory appropriately and then remove / rename the PHPBB functions as needed, while making them proper helpers or models.

common.php 文件可以在需要时重命名PHPBB函数,可能在 application / helpers 中找到一个 phpbb_helper 的家,等等。

The common.php file could probably find a home in application/helpers as phpbb_helper, and so on.


You obviously can not rename functions in the core PHPBB installation or it will break. Likewise, renaming common CI helper functions would be bad because it would break your ability to use sparks and other common libraries.


This isn't exactly 'quick', but should be workable in a couple of hours if you sat down determined to do it. And, you end up with decent reusable code that shouldn't be difficult to maintain so you never have to worry about it again.

这篇关于Codeigniter + PhpBB函数重新声明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

登录 关闭
发送“验证码”获取 | 15天全站免登陆