<?php
namespace Kyna\XenforoBundle\Service;
/**
* Connexion à la base de donnée Xenforo.
*/
class XenforoIntegration
{
public function xenforoConnect()
{
define('XF_ROOT', '/wamp/www/Project/forums'); // set this (absolute path)!
define('TIMENOW', time());
require_once(XF_ROOT . '/library/XenForo/Autoloader.php');
\XenForo_Autoloader::getInstance()->setupAutoloader(XF_ROOT . '/library');
\XenForo_Application::initialize(XF_ROOT . '/library', XF_ROOT);
\XenForo_Application::set('page_start_time', TIMENOW);
\XenForo_Application::disablePhpErrorHandler();
\XenForo_Application::setDebugMode(false);
\XenForo_Session::startPublicSession();
// \$userModel = XenForo_Model::create('XenForo_Model_User');
// \$userinfo = $userModel->getFullUserById($visitor->getUserId());
// \XenForo_Session::startPublicSession(new \Zend_Controller_Request_Http);
restore_error_handler();
restore_exception_handler();
}
}
$xenforoIntegration = new XenforoIntegration;
return $xenforoIntegration->xenforoConnect();