]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/event.php
Merge branch 'master' into social-master
[quix0rs-gnu-social.git] / lib / event.php
index 106bbfd041fef3f8828a2676e10bb8f4b04bf465..aa52fa361ca570f5605690fdbd0a3712387a719c 100644 (file)
@@ -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,12 @@ class Event {
         }
         return false;
     }
+
+    /**
+     * 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();
+    }
 }