Adding phpbb prefix to functions
- imkingdavid
- Registered User
- Posts: 1050
- Joined: Thu Jul 30, 2009 12:06 pm
Re: Adding phpbb prefix to functions
I suppose if all call sites are going to have to be changed anyway, it wouldn't hurt. But in the case of an optional parameter being added at the end, that does not count because not all call sites would have to be changed.
- callumacrae
- Former Team Member
- Posts: 1046
- Joined: Tue Apr 27, 2010 9:37 am
- Location: England
- Contact:
Re: Adding phpbb prefix to functions
Any decent IDE can change a function name and all calls.Oleg wrote:We are not going to be changing all functions. This involves too much work and will break everything because we don't have 100% test coverage, not to mention political unrest.
Can we keep on topic please? The case we are discussing changes required parameters which necessitates all call sites to be edited regardless of whether prefix is added or not.
- DavidIQ
- Customisations Team Leader
- Posts: 1905
- Joined: Thu Mar 02, 2006 4:29 pm
- Location: Earth
- Contact:
Re: Adding phpbb prefix to functions
Yep...and break almost every single MOD out there even if it had a chance it would still work in 3.1.callumacrae wrote:Any decent IDE can change a function name and all calls.Oleg wrote:We are not going to be changing all functions. This involves too much work and will break everything because we don't have 100% test coverage, not to mention political unrest.
Can we keep on topic please? The case we are discussing changes required parameters which necessitates all call sites to be edited regardless of whether prefix is added or not.
Re: Adding phpbb prefix to functions
Hence the reason we don't plan to change functions un-necessarily.DavidIQ wrote:Yep...and break almost every single MOD out there even if it had a chance it would still work in 3.1.callumacrae wrote:Any decent IDE can change a function name and all calls.Oleg wrote:We are not going to be changing all functions. This involves too much work and will break everything because we don't have 100% test coverage, not to mention political unrest.
Can we keep on topic please? The case we are discussing changes required parameters which necessitates all call sites to be edited regardless of whether prefix is added or not.
Formerly known as Unknown Bliss
No unsolicited PMs please except for quotes.psoTFX wrote: I went with Olympus because as I said to the teams ... "It's been one hell of a hill to climb"
Re: Adding phpbb prefix to functions
How about if we use that in conjunction to what I proposed?DavidIQ wrote:Yep...and break almost every single MOD out there even if it had a chance it would still work in 3.1.callumacrae wrote:Any decent IDE can change a function name and all calls.Oleg wrote:We are not going to be changing all functions. This involves too much work and will break everything because we don't have 100% test coverage, not to mention political unrest.
Can we keep on topic please? The case we are discussing changes required parameters which necessitates all call sites to be edited regardless of whether prefix is added or not.
Re: Adding phpbb prefix to functions
Then it adds a lot of overhead with little rewards/advantage.brunoais wrote:How about if we use that in conjunction to what I proposed?
Formerly known as Unknown Bliss
No unsolicited PMs please except for quotes.psoTFX wrote: I went with Olympus because as I said to the teams ... "It's been one hell of a hill to climb"
- bantu
- 3.0 Release Manager
- Posts: 557
- Joined: Thu Sep 07, 2006 11:22 am
- Location: Karlsruhe, Germany
- Contact:
Re: Adding phpbb prefix to functions
Considering that most of phpBB's functions are not prefixed, how about this:
3.0 modifications can then either
- Get rid of
global
statements in all functions for dependency injection (changing parameter list) - Add
phpbb_
prefix to all function names - Create 3.1 to 3.0 compatibility file with wrappers basically as per https://area51.phpbb.com/phpBB/viewtopi ... 53#p249253 importing variables from global space
3.0 modifications can then either
- be ported to 3.1 extensions (best)
- be ported to 3.1 modifications (updating function calls)
- include the compatibility file (basically saying "I just want this to work for now")
Re: Adding phpbb prefix to functions
That is very agreeable.
- EXreaction
- Registered User
- Posts: 1555
- Joined: Sat Sep 10, 2005 2:15 am
Re: Adding phpbb prefix to functions
I would agree to that except for requiring that mods include a compatibility file. This would require them to update anyways to include the file, so it would not be of benefit.
I would be good with one of the following:
1. Just include the compatibility file
2. Create a constant in the config file for new installs (PHPBB_COMPATIBILITY_MODE, set to false). If this constant is not set or is true, include the file, else do not.
Both options would preserve compatibility for upgrades, but the second option, for fresh installs, having it disabled would require administrators to enable it if they want to attempt to install old modifications.
I would be good with one of the following:
1. Just include the compatibility file
2. Create a constant in the config file for new installs (PHPBB_COMPATIBILITY_MODE, set to false). If this constant is not set or is true, include the file, else do not.
Both options would preserve compatibility for upgrades, but the second option, for fresh installs, having it disabled would require administrators to enable it if they want to attempt to install old modifications.
Re: Adding phpbb prefix to functions
+1EXreaction wrote:I would agree to that except for requiring that mods include a compatibility file. This would require them to update anyways to include the file, so it would not be of benefit.
I would be good with one of the following:
1. Just include the compatibility file
2. Create a constant in the config file for new installs (PHPBB_COMPATIBILITY_MODE, set to false). If this constant is not set or is true, include the file, else do not.
Both options would preserve compatibility for upgrades, but the second option, for fresh installs, having it disabled would require administrators to enable it if they want to attempt to install old modifications.
Formerly known as Unknown Bliss
No unsolicited PMs please except for quotes.psoTFX wrote: I went with Olympus because as I said to the teams ... "It's been one hell of a hill to climb"