X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fevent.php;h=e6bb41091e1d6f9f104c0b5f50adfb94b1c0092c;hb=0590f2975e6c5b26bbe6121da5c49890e035721e;hp=106bbfd041fef3f8828a2676e10bb8f4b04bf465;hpb=c5cf2c4c94794a1aeea32a427ddd50e157fa893d;p=quix0rs-gnu-social.git diff --git a/lib/event.php b/lib/event.php index 106bbfd041..e6bb41091e 100644 --- a/lib/event.php +++ b/lib/event.php @@ -27,7 +27,7 @@ * @link http://status.net/ */ -if (!defined('STATUSNET')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -98,7 +98,7 @@ class Event { * on results of handlers. */ - public static function handle($name, $args=array()) { + public static function handle($name, array $args=array()) { $result = null; if (array_key_exists($name, Event::$_handlers)) { foreach (Event::$_handlers[$name] as $handler) { @@ -138,4 +138,17 @@ class Event { } return false; } + + public static function getHandlers($name) + { + return Event::$_handlers[$name]; + } + + /** + * Disables any and all handlers that have been set up so far; + * use only if you know it's safe to reinitialize all plugins. + */ + public static function clearHandlers() { + Event::$_handlers = array(); + } }