From 02c2c3a6cca741967c1b2136453067da958b613d Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Wed, 30 Mar 2011 14:18:29 -0700 Subject: [PATCH] Provisional workaround for router inconsistencies in background processes that switch site configs. Ensure that router is cleared when we do site setup; we can still fetch the data from cache, so it should stay fast, but should ensure that we don't end up with someone else's routes still set up, which may be an issue breaking some of the bookmark handling that needs routing with a rare plugin. --- lib/router.php | 9 +++++++++ lib/statusnet.php | 2 ++ 2 files changed, 11 insertions(+) diff --git a/lib/router.php b/lib/router.php index e956b02c63..e3a9203e4d 100644 --- a/lib/router.php +++ b/lib/router.php @@ -126,6 +126,15 @@ class Router return Router::$inst; } + /** + * Clear the global singleton instance for this class. + * Needed to ensure reset when switching site configurations. + */ + static function clear() + { + Router::$inst = null; + } + function __construct() { if (empty($this->m)) { diff --git a/lib/statusnet.php b/lib/statusnet.php index 85b46bbb3f..2c38fc205f 100644 --- a/lib/statusnet.php +++ b/lib/statusnet.php @@ -107,6 +107,8 @@ class StatusNet */ public static function init($server=null, $path=null, $conffile=null) { + Router::clear(); + StatusNet::initDefaults($server, $path); StatusNet::loadConfigFile($conffile); -- 2.39.2