我试图将phpbb与symfony2 app集成。我只想使用phpbb和symfony2 app中的用户详细信息,我甚至没有用户模型/实体。
我想如果用户登录phpbb论坛并访问symfony2应用程序从phpbb会话中获取一些数据并显示它。
在app.php
我尝试过:
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : __DIR__.'/forum/';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
//Start session management
$user->session_begin();
$auth->acl($user->data);
在$ user->数据中需要信息,但是当app尝试创建请求时
$kernel = new AppKernel('dev', true);
$kernel->loadClassCache();
ini_set('display_errors', 'On');
$request = Request::createFromGlobals();
我收到错误:
Catchable fatal error: Argument 1 passed to Symfony\Component\HttpFoundation\Request::createRequestFromFactory() must be of the type array, object given, called in /home/g/projects/danger-cs/cs/app/bootstrap.php.cache on line 482 and defined in /home/g/projects/danger-cs/cs/app/bootstrap.php.cache on line 1222
我瘦的问题是在会话中,因为如果我注释phpbb的代码连接到函数createRequestFromFactory()
都传递了6个空数组,但是当连接到phpbb时,samo函数都传递了phpbb对象。
知道如何做我正在尝试的事情吗?或者另一个想法如何从phpbb用户获取数据?