@ nickvergessen
I like it.
[RFC|Merged] General Hook Architecture of phpBB3.1
Re: [RFC|Accepted] General Hook Architecture of phpBB3.1
The doc proposal looks great.
Anyone familiar with whatever documentation system we do or can use to automatically extract it?
Anyone familiar with whatever documentation system we do or can use to automatically extract it?
- nickvergessen
- Former Team Member
- Posts: 733
- Joined: Sun Oct 07, 2007 11:54 am
- Location: Stuttgart, Germany
- Contact:
Re: [RFC|Accepted] General Hook Architecture of phpBB3.1
As mentioned, it will be put into the wiki once the post is confirmed.EXreaction wrote:This should be in a wiki page of hook guidelines for future reference
we decided to use only one dot for the main prefix. everything else should use underscoresEXreaction wrote:Also, instead of core.group_remove_user, would core.group.remove_user make more sense?
Member of the Development-Team — No Support via PM
- nickvergessen
- Former Team Member
- Posts: 733
- Joined: Sun Oct 07, 2007 11:54 am
- Location: Stuttgart, Germany
- Contact:
Re: [RFC|Accepted] General Hook Architecture of phpBB3.1
Should events be wrapped with
if ($phpbb_dispatcher != null)
to avoid problems in all the functions, if the dispatcher is not set up (f.e. in tests or external usage)Member of the Development-Team — No Support via PM
Re: [RFC|Accepted] General Hook Architecture of phpBB3.1
I'd say no. The dispatcher should always be setup (this DIC will make this easier).nickvergessen wrote:Should events be wrapped withif ($phpbb_dispatcher != null)
to avoid problems in all the functions, if the dispatcher is not set up (f.e. in tests or external usage)
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: [RFC|Accepted] General Hook Architecture of phpBB3.1
You need to do that if you write code that allows $phpbb_dispatcher to be null. So basically it's a case by case decision, ideally if the dispatcher is passed as an argument it's defined by whether or not you add "= null" as a default as null will not be allowed otherwise. In cases where you still use it as a global variable, i guess it's really just a matter of whether you see a reasonable use case of calling the function without a dispatcher.
- imkingdavid
- Registered User
- Posts: 1050
- Joined: Thu Jul 30, 2009 12:06 pm
Re: [RFC|Accepted] General Hook Architecture of phpBB3.1
Why not instead of null check to see if it's a proper object...
Code: Select all
if ($phpbb_dispatcher instanceof phpbb_event_dispatcher)
{
// Event code here
}
Re: [RFC|Accepted] General Hook Architecture of phpBB3.1
IMO we should create a null dispatcher (or a mock) and pass that one instead.
Re: [RFC|Accepted] General Hook Architecture of phpBB3.1
Shouldn't this be marked as merged and a separate RFC created for template events?
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: [RFC|Accepted] General Hook Architecture of phpBB3.1
If someone creates a new RFC for template events this RFC can be merged.