views:

49

answers:

2

Hey SO,

I'm trying to include a premade messageboard, Phorum, into one of my Zend projects. Phorum is a relatively large and intricate web of PHP includes. My website already has a signup, so I'm trying to combine the two login systems into one.

What I've done is to make a controller that includes the Phorum index.php. This will let me use the authentication system I've set up. My problem is that, since I'm bootstrapping, all the relative filepaths within Phorum's index.php seem to try to begin at my Zend project's index.php, meaning they all seem to break.

Is there a way around this? Should I include? Render? Something better?

All help is appreciated.

+1  A: 

Adding the appropriate chdir (back to Phorums include path root) in your Bootstrap file should do it. Then you have to of course take care that you Zend App uses application specific and not relative paths.

Daff
That worked beautifully. Thanks!
Ethan
A: 

You can use the include_path setting, which can be set at runtime using set_include_path(). This doesn't require you to change the working directory, but makes PHP search for includes in all the directories specified in this setting.

Ignas R
Sounds good, too. It's sure worth a try but it could be, that you will have other folder related issues then (don't know how well Phorum deals with relative paths besides normal includes).
Daff
Yeah, I did a ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . BASE_PATH . '/phorum') in my bootstrap. I'm pretty sure that's the same thing. It still won't find it.
Ethan