My current Cake 1.2 app is bridged to phpBB. The best way to effect
this and get single site login using phpBB (2.X) ACL model,
authentication etc was to insert phpBBs session startup code and
necessary includes into WEBROOT/index.php at the very top, and to do
the necessary user management in a before filter of app_controller.
This way all my cake rendered pages were automatically authenticated,
sessionized, and ACLed based on the phpBB user model.

All works fine except both phpBB and CakePHP use the same DEBUG
constant for setting up DEBUGging. No problem -- given that Cake is a
much tidier source base and the constant is really used to prime the
debug class I chaned DEBUG to CAKE_DEBUG in a few files and all was
well. I could control Cake debugging levels and phpBB debug levels
independently.

This week I revisited experimenting with phpBB3 (Olympus) as it is
near its final release candidate. The phpBB3 source base is totally
object oriented, so I was not surprised when during my experimental
merge I found a class name collision, specifically for the Cache
class. I think it's actually amazing there weren't more collisions ;)

Anyway the solution once again was to edit about 4 Cake files to
rename the Cache class to CakeCache (the main 2 were cake/
bootsrtap.php and cake/libs/cache.php).

While it could have been much worse, I thought I would bring this to
the attention of the Cake developers. Not on whether it should change
Cake's naming of some internal classes but just to be aware that there
will be many php subsystems cakers are integrating, and these issues
do make life a bit more complex, especially during upgrade cycles.

While there may be a better way to bridge these subsystems and others
like them, I haven't found one that works better than what I have done
here -- to utilize phpBBs auth/ACL model and get single login you MUST
run the following code (in webroot/index.php) before anything else --
thus the cake engine as a tool for rendering dynamic content is loaded
after.

define('IN_PHPBB', true);
$phpbb_root_path = '../../../phpBB3/';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);

// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();

Thanks again to all who make cake possible -- it has made my
productivity significantly better compared to generic OO php
interfaceing to a DB.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to