diff options
author | chris <chris@jalakai.co.uk> | 2006-07-25 14:32:19 +0200 |
---|---|---|
committer | chris <chris@jalakai.co.uk> | 2006-07-25 14:32:19 +0200 |
commit | 063b1eb8ea7fecbdb4f1e694030fc4aa1f959089 (patch) | |
tree | 54f230a13e0d4f3ba3af12b94c5b96eaf2ae689d | |
parent | a5bc8bc1a2e9fc1e6e2b14ce3724dad56e8a42f0 (diff) | |
download | rpg-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
-rw-r--r-- | inc/events.php | 12 |
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 { |