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.
This commit is contained in:
Brion Vibber 2011-03-30 14:18:29 -07:00
parent 83d1997f59
commit 02c2c3a6cc
2 changed files with 11 additions and 0 deletions

View File

@ -126,6 +126,15 @@ class Router
return Router::$inst; 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() function __construct()
{ {
if (empty($this->m)) { if (empty($this->m)) {

View File

@ -107,6 +107,8 @@ class StatusNet
*/ */
public static function init($server=null, $path=null, $conffile=null) public static function init($server=null, $path=null, $conffile=null)
{ {
Router::clear();
StatusNet::initDefaults($server, $path); StatusNet::initDefaults($server, $path);
StatusNet::loadConfigFile($conffile); StatusNet::loadConfigFile($conffile);