Skip to content

Instantly share code, notes, and snippets.

@michaelcullum
Created March 29, 2012 14:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michaelcullum/2238175 to your computer and use it in GitHub Desktop.
Save michaelcullum/2238175 to your computer and use it in GitHub Desktop.
[10:52:58] <erik|iOS> Will the extension system get hooks to overrule page_header/page_footer? So basically replace them with your own
[10:53:18] <brunoais> I don't think so
[10:53:25] <brunoais> I think there will be a different thing
[10:53:30] <nickvergessen> erik|iOS: it doesnt have such a feature yet iirc
[10:53:57] <brunoais> it will be a template crawling for extensions (I don't know exaclty how to call it)
[10:54:23] <erik|iOS> nickvergessen: Okay. I'll post a request for it than
[10:54:38] <brunoais> you can register directly into the templating system your own version of the template that resides in your extension
[10:55:00] <brunoais> erik|iOS: did you read what I wrote?
[10:55:07] <brunoais> talk to arty
[10:55:11] <brunoais> he's doing that thing
[10:56:05] <brunoais> erik|iOS? you still here?
[10:56:12] <erik|iOS> brunoais: Yes
[10:56:22] <brunoais> did you read what I wrote?
[10:56:48] <erik|iOS> Templates wont do. I need to prevent those functions to be called and run my own code instead
[10:57:10] <erik|iOS> As there are quite some phpBB functions that call those
[10:57:15] <brunoais> oh... you mean really change the template variables?
[10:57:48] <erik|iOS> Just injecting logic won't do. I don't want the phpBB code in those functions to be ran in the first place
[10:58:09] * Connection failure: The remote host closed the connection
[10:58:09] <-- unknownbliss1 (~unknownbl@phpbb/website/Unknown-Bliss) has quit
[10:59:08] --> unknownbliss (~unknownbl@phpbb/website/Unknown-Bliss) has joined #phpBB-dev
[10:59:08] * Topic for #phpBB-dev is "phpBB Development Discussion - please use #phpbb for support and #phpbb-coding for MOD/Styles development | Rhea (v4) discussion: http://bit.ly/89MkFg | Note: All chat is being logged"
[10:59:08] * Topic set by DavidIQ on Mon 14. Mar 15:55:54 2011
[10:59:08] *** Mode #phpBB-dev +o unknownbliss by ChanServ
[10:59:08] <cyberalien> in current version it is sort of supported
[10:59:19] *** Mode #phpBB-dev +cnt by verne.freenode.net
[10:59:20] * Channel #phpBB-dev created on Sun 27. Feb 17:46:08 2011
[10:59:38] <cyberalien> because extension path finder inserts extension paths before style paths (incorrect behavior), extension specific templates override default style's templates
[10:59:55] <erik|iOS> nn-: Sure. That isn't the issue. I'll see whether I can write some pretty story
[11:00:38] <erik|iOS> cyberalien: But than when pager_header is called from fir example login_box the function is still executed
[11:01:56] <-- unknownbliss1 (~unknownbl@phpbb/website/Unknown-Bliss) has quit (Ping timeout: 252 seconds)
[11:07:02] --> shibulijack (7085c403@gateway/web/freenode/ip.112.133.196.3) has joined #phpBB-dev
[11:07:27] <shibulijack> unknownbliss: u there?
[11:07:48] <unknownbliss> yes but busy
[11:08:37] <-- _hsr (b00t@unaffiliated/b00t) has quit (Ping timeout: 244 seconds)
[11:09:39] --> rahulr92 (~rahul@117.213.6.53) has joined #phpBB-dev
[11:10:13] <nn-> it does not need to be pretty
[11:11:40] <-- shibulijack (7085c403@gateway/web/freenode/ip.112.133.196.3) has quit (Ping timeout: 245 seconds)
[11:12:37] <-- erik|iOS (~erikfrere@phpbb/support/erikfrerejean) has quit (Read error: Connection reset by peer)
[11:12:38] --> erik|iOS_ (~erikfrere@phpbb/support/erikfrerejean) has joined #phpBB-dev
[11:12:38] *** Mode #phpBB-dev +o erik|iOS_ by ChanServ
[11:14:48] --> _hsr (b00t@unaffiliated/b00t) has joined #phpBB-dev
[11:19:45] --> Raimon|iPad (~Raimon|iP@phpbb/manager/Raimon) has joined #phpBB-dev
[11:19:46] *** Mode #phpBB-dev +o Raimon|iPad by ChanServ
[11:30:26] <erik|iOS_> nn-: Posted proposal. Let me know if I missed something
[11:31:43] <nn-> erik| please specify where in the code you want to have the event
[11:31:48] <nn-> and what its parameters should be
[11:32:02] <nn-> all of our parameters are in/out
[11:32:15] <nn-> to return a flag from listener you have to pass a boolean in as a parameter
[11:32:19] <nn-> something like $show_header
[11:32:29] <nn-> then you can change it in the listener
[11:32:47] <nn-> accordingsy you need to also specify what code will become conditional on that flag
[11:33:06] <nn-> and what the behavior would be if that code does not run, in the event the flag is changed to false
[11:33:39] <erik|iOS_> Okay.
[11:34:08] <erik|iOS_> I'll investigate a bit more on the workings of the event handler
[11:47:24] <-- rahulr92 (~rahul@117.213.6.53) has quit (Ping timeout: 252 seconds)
[11:52:06] <erik|iOS_> nn-: would it be acceptable it the event sets an "skip" argument in the return data and than add an `if (skip) return;` the line after the dispatcher call?
[11:52:29] <-- JanSch_ (~JanSch__@p4FD78429.dip0.t-ipconnect.de) has quit (Ping timeout: 260 seconds)
[11:54:44] <unknownbliss> nn-: Why is the old hooks system still there? It should probably either be removed or added to extensions.
[11:54:50] <unknownbliss> CC: igorw
[11:55:29] <nn-> unknownbliss: let's not get carried away
[11:55:46] <nn-> and one thing at a time
[11:55:59] <unknownbliss> fair point
[11:56:19] <unknownbliss> But doing the latter [b]should[/b] just be a few lines of code
[11:56:26] <nn-> erik| yes probably
[11:56:35] <nn-> except there is no "return data"
[11:56:38] <nn-> all parameters are in and out
[11:56:53] <nn-> unknownbliss: feel free to take a stab at it
[11:56:56] <nickvergessen> <@erik|iOS_> nn-: would it be acceptable it the event sets an "skip" argument in the return data and than add an `if (skip) return;` the line after the dispatcher call?
[11:57:04] <nickvergessen> was my first and best idea aswell so far
[11:57:45] <erik|iOS_> I understand that but if you add an "skip = false" in you could change that to true in the event. Right?
[11:57:55] <nn-> yes
[11:58:24] <nickvergessen> we can also add that parameter in the other function?
[11:58:32] <nickvergessen> so we dont have to edit all places=
[11:59:00] <erik|iOS_> Okay. I need to get a lot more familliar with the event system :?
[11:59:13] <unknownbliss> nn-: After I've finished more important stuff
[11:59:32] <unknownbliss> erik|iOS_: Most of the events stuff you need to know about is symfony
[11:59:40] <nn-> http://wiki.phpbb.com/Category:Events_and_Listeners
[12:00:03] <unknownbliss> erik|iOS_: Just a note though, we use a event dispatcher wrapper
[12:00:41] <unknownbliss> erik|iOS_: Look through https://github.com/phpbb/phpbb3/pull/529
[12:00:52] <nn-> unknownbliss: https://github.com/phpbb/phpbb3/pull/571 ;)
[12:01:18] <unknownbliss> hm... Thats got all the events in so the diff is rather large and more difficult to digest
[12:01:32] <erik|iOS_> Okay. Thanks :)
[12:02:14] <unknownbliss> oh I just opened the link, I assumed it was the hooks v2 PR.
[12:02:50] <unknownbliss> I'll have a look at that later on
[12:03:10] <nn-> erik| but generally speaking your proposal seems sensible
[12:03:34] <-- Raimon|iPad (~Raimon|iP@phpbb/manager/Raimon) has quit (Quit: Colloquy for iPhone - http://colloquy.mobi)
[12:03:35] <nn-> certainly we can take action based on what a listener returns
[12:05:18] <erik|iOS_> nn-: Okay. The same thing also applies to `trigger_error`. phpBB calls that all over the place making certain actions hard to do when outside the acp for example.
[12:05:44] <erik|iOS_> Luckily ;)
[12:06:29] <brunoais> _hsr: Just to make certain that I passed the right message: I'm programming at phpbb because I want to and because I like to program to improve a project. I'm at GSoC because I want the money for programming (the status for the CV is good also :)). That's how I work and I hope ppl respect that.
[12:07:06] <nn-> i don't know if i like the idea of listeners changing trigger_error calls
[12:07:14] <nn-> seems like too much of a hack possibly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment