Created
March 19, 2012 14:16
-
-
Save rxu/2113808 to your computer and use it in GitHub Desktop.
Extract into globals
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Param $event_data array Compacted array of variables | |
function phpbb_add_event($event_name = '', $event_data = array()) | |
{ | |
global $phpbb_dispatcher; | |
// Return if no event data is given | |
if (empty($event_name) || empty($event_data)) | |
{ | |
return; | |
} | |
// Globalize compacted variables | |
foreach ($event_data as $key => $value) | |
{ | |
global $$key; | |
} | |
$event = new phpbb_event_data($event_data); | |
$phpbb_dispatcher->dispatch($event_name, $event); | |
extract($event->get_data_filtered($event_data)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment