summaryrefslogtreecommitdiff
path: root/inc/events.php
diff options
context:
space:
mode:
authorchris <chris@jalakai.co.uk>2006-07-25 14:32:19 +0200
committerchris <chris@jalakai.co.uk>2006-07-25 14:32:19 +0200
commit063b1eb8ea7fecbdb4f1e694030fc4aa1f959089 (patch)
tree54f230a13e0d4f3ba3af12b94c5b96eaf2ae689d /inc/events.php
parenta5bc8bc1a2e9fc1e6e2b14ce3724dad56e8a42f0 (diff)
downloadrpg-063b1eb8ea7fecbdb4f1e694030fc4aa1f959089.tar.gz
rpg-063b1eb8ea7fecbdb4f1e694030fc4aa1f959089.tar.bz2
events.php update
fixes issue whereby event handler objects (e.g. action plugins) were being copied rather than accessed by reference. darcs-hash:20060725123219-9b6ab-d684db577251b108a062a41a2b1ee1eda472f835.gz
Diffstat (limited to 'inc/events.php')
-rw-r--r--inc/events.php12
1 files changed, 8 insertions, 4 deletions
diff --git a/inc/events.php b/inc/events.php
index 4563f2c75..cb3f52143 100644
--- a/inc/events.php
+++ b/inc/events.php
@@ -120,7 +120,7 @@ class Doku_Event_Handler {
// private properties
var $_hooks = array(); // array of events and their registered handlers
- /*
+ /**
* event_handler
*
* constructor, loads all action plugins and calls their register() method giving them
@@ -139,7 +139,7 @@ class Doku_Event_Handler {
}
}
- /*
+ /**
* register_hook
*
* register a hook for an event
@@ -151,7 +151,7 @@ class Doku_Event_Handler {
* @PARAM $param (mixed) data passed to the event handler
*/
function register_hook($event, $advise, &$obj, $method, $param=NULL) {
- $this->_hooks[$event.'_'.$advise][] = array($obj, $method, $param);
+ $this->_hooks[$event.'_'.$advise][] = array(&$obj, $method, $param);
}
function process_event(&$event,$advise='') {
@@ -161,7 +161,11 @@ class Doku_Event_Handler {
if (!empty($this->_hooks[$evt_name])) {
$hook = reset($this->_hooks[$evt_name]);
do {
- list($obj, $method, $param) = $hook;
+// list($obj, $method, $param) = $hook;
+ $obj =& $hook[0];
+ $method = $hook[1];
+ $param = $hook[2];
+
if (is_null($obj)) {
$method($event, $param);
} else {