Generic Class names causing integration issues

Do not post support requests, bug reports or feature requests. Discuss phpBB here. Non-phpBB related discussion goes in General Discussion!
Scam Warning
Post Reply
geeffland
Registered User
Posts: 24
Joined: Fri Dec 16, 2005 5:56 am

Generic Class names causing integration issues

Post by geeffland »

I have been a member of this board for a while and am currently a developer of a connector ('bridge') between phpbb and Community Builder... Before I start I must say that I am very impressed with phpbb3 as compared with phpbb2 and will be expanding the features of my own connector to take advantage of some of the new phpbb3 features... Thanks for the new version!!!!! ... continuing on

I have had this question in the back of my mind for a while and after searching again recently the age old question came back.

I have a topic I would like to discuss, which depending on the results of the discussion might result in a feature request. Almost every forum here says no posting of feature requests. I saw a mention of the sourceforge feature request area and it says don't post here unless redirected from a phpbb team member (my wording)... so I am confused on how they get redirected there if they can't discuss it here...

I am not trying to cause a problem on this site... and since I develop code as well I know that sometimes you can get swamped with feature requests and some may not be possible... but it is still nice to grab the ideas as some may not make sense or be possible now but later might be great.

So I have not posted my particular topic of interest here yet because I would like to get some guidance as to this sites desired way to proceed or where to discuss.

Since this topic is somewhat error based should I post with the error first even though I am pretty sure of what will be needed to avoid the error?

Respectfully,
Greg
Last edited by geeffland on Mon Aug 20, 2007 5:36 pm, edited 2 times in total.
User avatar
KevC
Support Team Member
Support Team Member
Posts: 70218
Joined: Fri Jun 04, 2004 10:44 am
Location: Oxford, UK
Contact:

Re: phpbb.com forum posting confusion

Post by KevC »

phpBB3 was feature locked a very long time ago so it would more likely end up as a MOD request.

I reckon start your discussion point and see where it goes.
-:|:- Support Request Template -:|:-
Image
Cheap UK Hosting
"In the land of the blind the little green bloke with no pupils is king - init!"
geeffland
Registered User
Posts: 24
Joined: Fri Dec 16, 2005 5:56 am

Generic Class names causing issues when integrating

Post by geeffland »

I have noticed while integrating phpbb3 with a bridge into Joomla that generic class names can cause issues. The 1 particular case that I have had reported to myself is the class "template"... when a user is implementing a Joomla module of mine that lists last posts, etc. if shows a warning of not being able to redeclare the class template... (FWIW, the module includes the common.php and other starter files of phpbb3)

I know this can be a pain to refactor but if phpbb3 where to use a prefix or suffix on class names then it could ensure that integration problems like this did not exist... a similar comment could be said about function names as well.

I don't think this would fit into a MOD as it would basically require a serious rewrite of the base phpbb... So how should I go about presenting this to the phpbb core team to get their feedback?

Has anyone else run into this?

Thanks,
Greg
User avatar
Brf
Support Team Member
Support Team Member
Posts: 52127
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Generic Class names causing integration issues

Post by Brf »

If you are creating a port, I suppose you could name your classes whatever you want. The template class itself is only accessed once IIRC... There in common.php

Code: Select all

$template	= new template();
so you could always rename the class to phpbb_template for instance, and change that line to

Code: Select all

$template	= new phpbb_template();
User avatar
drathbun
Former Team Member
Posts: 12204
Joined: Thu Jun 06, 2002 3:51 pm
Location: TOPICS_TABLE
Contact:

Re: Generic Class names causing integration issues

Post by drathbun »

I see the issue, I think... it's not so much that they're able to rename the other item as it, too, might be a custom package. For example, if phpBB were to preface every class with phpbb3_xxx then there would not be any conflicts. Wordpress, for example, often uses wp_ to tag their stuff. So where phpbb2 has a generic "redirect" function Wordpress calls theirs wp_redirect(). They use wp-config.php instead of config.php. They use wp-admin instead of admin. And so on.

So if phpBB were to follow a similar pattern, their template class would be called phpbb_template instead of just template, and life would be easier for folks trying to combine two different packages. :)
I blog about phpBB: phpBBDoctor blog
Still using phpbb2? So am I! Click below for details
Image
geeffland
Registered User
Posts: 24
Joined: Fri Dec 16, 2005 5:56 am

Re: Generic Class names causing integration issues

Post by geeffland »

I am not so concerned about filenames as they should be in different directories most of the time... although I guess I could see where from a pure MOD standpoint that the naming convention could help there as well... function and class names though can conflict anytime the files are combined in memory.

drathbun... I see you are a moderator... from your experience how do I get a core developer's opinion or get this put on a feature request for a future version?

Greg
SamG
Former Team Member
Posts: 3221
Joined: Fri Aug 31, 2001 6:35 pm
Location: Beautiful Northwest Lower Michigan
Name: Sam Graf

Re: Generic Class names causing integration issues

Post by SamG »

I know I'm not drathbun, but I'll just toss in the thought that since the developers currently are trying to finish up a major rewrite (hence 3.0) I don't think now is the time to suggest another. :)

But, it seems like a worthwhile point for some discussion (feature suggestions being closed at this point), so I suggest you take the discussion to phpBB's development board, perhaps in the [3.x/Olympus] Discussion forum. That's probably the best place to work the idea over with the future in mind.
User avatar
poyntesm
Registered User
Posts: 1671
Joined: Tue Jan 18, 2005 11:19 am
Location: Dublin, Ireland
Contact:

Re: Generic Class names causing integration issues

Post by poyntesm »

Also the dev team have stated on many times they are happy for people to report what the user thinks is a genuine bug. They might "will not fix" it, they might "not a bug" it but you never know it might get a "review later".

It might be possible they will change it only in the class definition and object creation points.

So we would still have $template but it would be calling class of phpbb3_template. Like how $db is really dbal_mysqli or whatever your DBMS is. That would get over the redeclare issue. Now if they also referenced it as $template it would be a bigger change.

Best way to see is a bug report.
User avatar
poyntesm
Registered User
Posts: 1671
Joined: Tue Jan 18, 2005 11:19 am
Location: Dublin, Ireland
Contact:

Re: Generic Class names causing integration issues

Post by poyntesm »

So its a will not fix...Not the end of the road for it though..as I believe the statement below gives hope for the future.
All reports tagged as "Will not fix" will get reviewed later for inclusion
into the next major or minor version.
Prince of phpbb
Registered User
Posts: 286
Joined: Mon Jun 13, 2005 12:29 pm
Location: UK
Contact:

Re: Generic Class names causing integration issues

Post by Prince of phpbb »

Personally I think its a really good (and valid) suggestion. But as SamG said phpBB is about to go Gold and any change of this magnitude at this is stage has to be postponed. But I do believe the Devs will come back to it in the future because I do remember Acyd Burn mentioning somewhere on area51 that phpBB3 is really easy to implement in a CMS. This clearly suggests that the Devs do that third-party softwares in mind.

PS: Just in case they do not, lets submit a request for a petition MOD :P (J/K)
User avatar
drathbun
Former Team Member
Posts: 12204
Joined: Thu Jun 06, 2002 3:51 pm
Location: TOPICS_TABLE
Contact:

Re: Generic Class names causing integration issues

Post by drathbun »

geeffland wrote:drathbun... I see you are a moderator... from your experience how do I get a core developer's opinion or get this put on a feature request for a future version?
The suggestions that came after this post are probably the best route to take. That's what I would have to do, just like anyone else. :)
I blog about phpBB: phpBBDoctor blog
Still using phpbb2? So am I! Click below for details
Image
Post Reply

Return to “phpBB Discussion”