• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
  • This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

XenForo and CodeIgniter Integration

Jerry

Well-known member
#4
Much more lightweight, easier to learn, no auto code generation so you know what's in there - because you wrote it - it's less capable with regard to libraries and community support and expansion I'd say.

Though for 80% of what people do, DX auth/tank auth/a3m & CodeIgniter and you're good to go.

ZF is very expansive and slow to get going on for most coders I've talked with about it.
 
F

Floris

Guest
#9
Jerry, for the epic win.
Now let's hope IB didn't have a CI+XenForo integration planned for vB5 !!
 

RickM

Well-known member
#10
Sorry to bump up a year old thread. I'm trying to use Jerry's code on a Codeigniter based site however it looks like any code igniter commands that are run after loading in the xf_auth library dont work, as it is trying to run them as part of xenforo.

For example, a simple test controller in CI:

PHP:
class Test extends Public_Controller
{
    public $data;
 
    public function __construct()
    {
        parent::__construct();
       
    }
   
    function index()
    {
   
        $this->load->library('xf_auth');
       
        if($this->xf_auth->isLoggedIn())
        {
            echo "You're logged in to XenForo !" .
            " User id :: " . $this->xf_auth->getUserId() .
            " username :: " . $this->xf_auth->get('username') .
            " email :: " . $this->xf_auth->get('email');
        }
        else
        {
            echo "You are not logged in";
        }
       
        $this->load->model('some_model_name');
    }
   
}
With that model line there, I get this error:
Code:
You're logged in to XenForo ! User id :: 1 username :: Rick email :: xxxxxx@xxxxxx.com
An exception occurred: Only variables should be passed by reference in /Volumes/User Drive/htdocs/xxxxxxxxxx/site/system/cms/libraries/MX/Loader.php on line 178
 
XenForo_Application::handlePhpError() in /Volumes/User Drive/htdocs/xxxxxxxxxx/site/system/cms/libraries/MX/Loader.php at line 178
MX_Loader->model() in /Volumes/User Drive/htdocs/xxxxxxxxxx/site/addons/shared_addons/modules/xxx/controllers/test.php at line 37
Test->index()
call_user_func_array() in /Volumes/User Drive/htdocs/xxxxxxxxxx/site/system/codeigniter/core/CodeIgniter.php at line 352
require_once() in /Volumes/User Drive/htdocs/xxxxxxxxxx/site/index.php at line 259
Any ideas? Completely stumped. The XenForo integration seems to be working, but anything after that fails.