Let's try to restrict the scope of this RFC.
If parameter list of a function is changed, do you support adding phpbb prefix to its name at the same time?
Adding phpbb prefix to functions
- imkingdavid
- Registered User
- Posts: 1050
- Joined: Thu Jul 30, 2009 12:06 pm
Re: Adding phpbb prefix to functions
Only new functions should get a phpbb_ prefix, imo. Basically, any time you'd have to go through existing code and change the function calls, I would vote against it. Functions added in new PRs need the prefix, though.Oleg wrote:Let's try to restrict the scope of this RFC.
If parameter list of a function is changed, do you support adding phpbb prefix to its name at the same time?
Re: Adding phpbb prefix to functions
You have to change call sites anyway because of changed parameter list?
Re: Adding phpbb prefix to functions
I see your point thinking about it, the original aim was probably to remove them in future but even then it will still break BC, just less BC. However if we did implement wrapper then +1 to the above quote.EXreaction wrote:At the least, wrappers should be put in a separate file so they can be cleaned up in the future and managed by the board administrator if they must deal with a specific collision incident and should not be wrapped in if (!function_exists()).
Unless it is added to the end & is optional (therefore doesn't break BC) I'd +1 to changing it as the calls & BC are being changed/broken (respectively) anyway.Oleg wrote:If parameter list of a function is changed, do you support adding phpbb prefix to its name at the same time?
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"
- EXreaction
- Registered User
- Posts: 1555
- Joined: Sat Sep 10, 2005 2:15 am
Re: Adding phpbb prefix to functions
I believe that changing the parameter list should be prevented unless absolutely necessary as well.Oleg wrote:Let's try to restrict the scope of this RFC.
If parameter list of a function is changed, do you support adding phpbb prefix to its name at the same time?
If it is necessary to change the parameter list and the inputs are not optional, then the BC has been broken, so changing the function name is not an issue (though if it is not just prefixed and the function name is changed I'd like to see a comment on the function including the old name).
As per my previous comment, if we create a file to contain wrapper functions and depreciate the old function names over a few major versions, I would not have a problem with renaming the functions because extension authors would have a while to update and board owners could manage any compatibility issues on their own (in the case of conflicts, remove the wrappers and deal with any old calls to the function; in the case of older code that was written, keep the wrappers beyond the time when they are depreciated and removed).
Re: Adding phpbb prefix to functions
It is quite important in automated testing. 3.1 contains BC breaks, there is nothing that says it can't, we just avoid them as much as possible. This will probably change for x.y releases so that only x releases get BC breaks after 3.1 but for 3.1 I think we can accept there may be some small BC breaks.EXreaction wrote:I believe that changing the parameter list should be prevented unless absolutely necessary as well.Oleg wrote:Let's try to restrict the scope of this RFC.
If parameter list of a function is changed, do you support adding phpbb prefix to its name at the same time?
If it is necessary to change the parameter list and the inputs are not optional, then the BC has been broken, so changing the function name is not an issue (though if it is not just prefixed and the function name is changed I'd like to see a comment on the function including the old name).
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"
- EXreaction
- Registered User
- Posts: 1555
- Joined: Sat Sep 10, 2005 2:15 am
Re: Adding phpbb prefix to functions
What is quite important in automated testing?
- DionDesigns
- Registered User
- Posts: 51
- Joined: Sat Apr 21, 2012 4:29 am
- Location: Uncertain due to momentum
- Contact:
Re: Adding phpbb prefix to functions
FYI: http://www.jfusion.org/forums/viewtopic.php?t=6795EXreaction wrote:Unless there is a specific incident with naming collision with other popular software, I do not support renaming existing functions.
Re: Adding phpbb prefix to functions
For me, we should change all functions to use the
With that for the next one or two subversions, we would still support the non prefixed function.
This is made in a very simple way. Just cut and paste the code from the non
With this we keep the backwards compatibility for the MOD authors (and forgotten code) at the expense of a minor performance hit while loading the files and while the functions are used this way.
phpbb_
prefix.With that for the next one or two subversions, we would still support the non prefixed function.
This is made in a very simple way. Just cut and paste the code from the non
phpbb_
prefixed function into the phpbb_
prefixed function. Just write the code needed to call the function with the same name but with the phpbb_
prefix. Something like this:
Code: Select all
phpbb_function_name($param1, $param2)
{
// useful code
}
function_name($param1, $param2)
{
return phpbb_function_name($param1, $param2);
}
Re: Adding phpbb prefix to functions
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.
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.