Symfony2 + phpBB

Discussion forum for Extension Writers regarding Extension Development.
nayro
Registered User
Posts: 6
Joined: Tue Jul 07, 2015 8:22 am

Symfony2 + phpBB

Post by nayro »

Hello,

For a personal website (for a guild in a game), I would like to use Symfony2 framework, integrate a phpBB forum and use the phpBB sessions in my sf2 app to have just one account for the entire website. I have some experiences with Sf2 that's why I really want to use it.

Currently I have successfully installed my Symfony2 application. Regarding the forum, I created a "forum" folder where I put the phpBB, and I put a symbolic link to my forum folder into the Symfony2 web directory.
I have access to my forum at /forum/index.php, I put a line which is supposed to redirect to my forum in the Symfony2 .htaccess, but it doesn't work :( :
RewriteRule ^forum/$ forum/index.php [QSA,L]

But the main reason why I came here is the session sharing between Sf2 and phpBB, I found this bundle :
https://github.com/phpbb/PhpbbSessionsAuthBundle

It seems to be exactly what I want, unfortunately there is no documentation :( once the bundle is installed and configured, I have no idea what I have to do :/
I used to use FOSUserBundle to manage my users in Symfony2 and here I'm lost :/

If someone could give me a hand, maybe someone who have already used this bundle it would be really really great ^^

Thanks in advance
Paul
Infrastructure Team Leader
Infrastructure Team Leader
Posts: 28654
Joined: Sat Dec 04, 2004 3:44 pm
Location: The netherlands.
Name: Paul Sohier
Contact:

Re: Symfony2 + phpBB

Post by Paul »

The linked sessions bundle is still in development, and hasn't been completed or tested yet.
However, I don't think it will completly work in your case. The bundle will use phpBB as user provided, and as such won't work well together with fos_user.
nayro
Registered User
Posts: 6
Joined: Tue Jul 07, 2015 8:22 am

Re: Symfony2 + phpBB

Post by nayro »

Hello Paul and thanks for your help,

It's not a problem if I will not use FOSUserBundle, I just want to have access to the connected user (I mean connected with the phpBB forum) in my Symfony2 application.

What I would like to have is that the users of the website have only one account for both the forum and the Symfony2 application. That's why I thought I can share the phpBB sessions into my sf2 application.

For example, if I make an administration page into my symfony2 application, I would like to have the user connected with the forum and check his group. Or develop an interface for the users to subscribe for the raids.

Is it possible ? :/
Paul
Infrastructure Team Leader
Infrastructure Team Leader
Posts: 28654
Joined: Sat Dec 04, 2004 3:44 pm
Location: The netherlands.
Name: Paul Sohier
Contact:

Re: Symfony2 + phpBB

Post by Paul »

Yeah, thats basically what the bundle will do. It will use the session cookies phpBB creates, and from that session cookie it selects the user from the users table from phpBB.
Like I said, the bundle is not fully finished yet, we still need to do some work on it before it is usable. However, we need the bundle ourselves for the website as well, so it might happen pretty soon, but I can't give any time frames.
nayro
Registered User
Posts: 6
Joined: Tue Jul 07, 2015 8:22 am

Re: Symfony2 + phpBB

Post by nayro »

I can develop a temporary solution until your bundle is fully finished and documented, like you said the bundle does exactly what I want to do ^^

Could you bookmark this topic and post a message when the bundle is available ? I subscribed to this topic, so I think I will get a message when someone posts.

Thanks for your help !
User avatar
Oyabun1
Former Team Member
Posts: 23162
Joined: Sun May 17, 2009 1:05 pm
Location: Australia
Name: Bill

Re: Symfony2 + phpBB

Post by Oyabun1 »

Better to watch the Github repository.
                      Support Request Template
3.0.x: Knowledge Base Styles Support MOD Requests
3.1.x: Knowledge BaseStyles SupportExtension Requests
nayro
Registered User
Posts: 6
Joined: Tue Jul 07, 2015 8:22 am

Re: Symfony2 + phpBB

Post by nayro »

Yeah good idea, I will do that thanks ^^
nayro
Registered User
Posts: 6
Joined: Tue Jul 07, 2015 8:22 am

Re: Symfony2 + phpBB

Post by nayro »

Hello again ^^

As a temporary solution, I would like to share phpBB session like this tutorial :
https://www.phpbb.com/support/docs/en/3 ... tegration/

So I included this code into a controller :

Code: Select all

public function indexAction()
    {
        define('IN_PHPBB', true);
        define('ROOT_PATH', "./forum");
 
        if (!defined('IN_PHPBB') || !defined('ROOT_PATH')) {
            exit();
        }
 
        $phpEx = "php";
        $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : ROOT_PATH . '/';
        include($phpbb_root_path . 'common.' . $phpEx);
 
        $user->session_begin();
        $auth->acl($user->data);
        echo "<pre>";
        print_r($user);
        echo "</pre>";
        exit;
}
Unfortunately, it doesn't work I get a white page. But if I put this code into a basic file in the web directory (for example test.php), it works...

So I tested to put this code into app.php and just make an echo into my symfony's controller it works, it displays my user connected with phpBB, but it doesn't enter in my controller, it doesn't make the echo. So I began to debug by removing the line one by one, and the problem is when I make the phpBB include :

Code: Select all

include($phpbb_root_path . 'common.' . $phpEx);
When I put this line, it doens't enter in my controller...

I know it's not a forum to help symfony developpers, but I'm almost there, if I can do that I have access to the phpBB user's session and I could finally start developing my web application :/
nayro
Registered User
Posts: 6
Joined: Tue Jul 07, 2015 8:22 am

Re: Symfony2 + phpBB

Post by nayro »

Up, anyone has an idea ? ^^
dorwido
Registered User
Posts: 1
Joined: Tue Aug 11, 2015 5:11 pm

Re: Symfony2 + phpBB

Post by dorwido »

Found that bundle too and doing what I would like todo, but sadly as other here due the slack of documentation I dont have a clue how to implement it, seems sadly alot of symfony2 bundles to require expert knowledge :-(
Paul
Infrastructure Team Leader
Infrastructure Team Leader
Posts: 28654
Joined: Sat Dec 04, 2004 3:44 pm
Location: The netherlands.
Name: Paul Sohier
Contact:

Re: Symfony2 + phpBB

Post by Paul »

Like said before, the bundle is still in development and not yet working. There will be hopefully a first version soon, Including documentation.
RedactUK
Registered User
Posts: 60
Joined: Mon Apr 12, 2004 10:02 am
Location: Cambridge, UK
Contact:

Re: Symfony2 + phpBB

Post by RedactUK »

This is all exactly what I'm trying to do, but not getting very far.
I've been watching PhpbbSessionsAuthBundle for many months.. hoping for update soon :)
RedactUK
Registered User
Posts: 60
Joined: Mon Apr 12, 2004 10:02 am
Location: Cambridge, UK
Contact:

Re: Symfony2 + phpBB

Post by RedactUK »

Paul, any chance of rough ETA on this? e.g. 1-3 months/before Christmas, or 3-6 months+
Daniel84
Registered User
Posts: 2
Joined: Fri Oct 02, 2015 4:25 pm

Re: Symfony2 + phpBB

Post by Daniel84 »

any update here? working on a integration for contao cms and this could be quite useful
jdeniau
Registered User
Posts: 2
Joined: Fri Oct 13, 2017 8:58 pm

Re: Symfony2 + phpBB

Post by jdeniau »

Hi,

Sorry to dig out this topic, but I encounter the same problem myself.

I looked up on all the forks that have been made of this repository, and improved the one that seems to be the most advanced and working with PhpBB 3.x

The code can be found here and the PR made on judu's repository is here for discussion.

Are you interested in merging our work in the master repository ?

This is not perfect, some config point are missing, but I think it's pretty stable.

Thanks
Post Reply

Return to “Extension Writers Discussion”