/** * Initialize, or re-initialize, StatusNet global configuration * and plugins. * * If switching site configurations during script execution, be * careful when working with leftover objects -- global settings * affect many things and they may not behave as you expected. * * @param $server optional web server hostname for picking config * @param $path optional URL path for picking config * @param $conffile optional configuration file path * * @throws NoConfigException if config file can't be found */ public static function init($server = null, $path = null, $conffile = null) { Router::clear(); StatusNet::initDefaults($server, $path); StatusNet::loadConfigFile($conffile); $sprofile = common_config('site', 'profile'); if (!empty($sprofile)) { StatusNet::loadSiteProfile($sprofile); } // Load settings from database; note we need autoload for this Config::loadSettings(); self::initPlugins(); }